Thank you for your email, it worked nicely.
Now I have another question not related to this one, and I am not sure if
this is the right list or if there is a specialized list.
It has to do with Npgsql, the C# interface to postgres.
I have a table that looks like the following
Suppose I have a row on this table e.g.
120120 ....... www.record.pt\
If , on PgAdmin, I query
I get nothing, as expected, because the string has two final backslashes,
not one, as the record on table.
But if I try to do it on C# it returns me the 120120. (??) It shouldn't
return nothing as well.
The program is as follows :
strSite = "www.record.pt\\\\"
strQuery = "SELECT \"IDSite\" FROM t_sites " + "WHERE \"tName\" = '" +
strSite + "'";
cSqlCommand = new NpgsqlCommand(strQuery, m_cConnectionToDb);
i_int_rec.IDSite = (int)cSqlCommand.ExecuteScalar();
/* This code is not executed */
i.e. the ExecuteScalar() Method returns one key, the www.record.pt\ one,
120120, but it should return null, because the result should be empty.
www.record.pt\ != www.record.pt\\ , is that not true?
Does the ExecuteScalar() method remove additional backslashes or kinda?
Actually I did on C# a small test program that issues the
query against my postgres database and then lists the results on screen, and
the fact is that www.record.pt\\ does not appear which is correct.
Still, ExecuteScalar() behaves as the record was there and returns the
primary key of ...the www.record.pt\ which is not the right one!
Can anyone please kindly indicate what am I doing wrong on the program?
Any help/advice deeply appreciated
2007/5/4, Phillip Smith <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>:
> I'm not familiar with PGAdmin, but with console you can use a way likethis to insert the contents of a CSV-file into a database table on aremote host:
> cat <file.csv> | ssh <host> "psql -U <user> <database> -c 'copy <table> from stdin;'"
> You can do the same from pgAdmin, you just need to upload the file to the
> server first, then do something like:
> COPY table1 FROM '/tmp/file1.txt';
> Remember to write the path as the SERVER will see it, not as the client
> sees it!
> ********************Confidentiality and Privilege
> The material contained in this message is privileged and confidential to
> the addressee. If you are not the addressee indicated in this message or
> responsible for delivery of the message to such person, you may not copy or
> deliver this message to anyone, and you should destroy it and kindly notify
> the sender by reply email.
> Information in this message that does not relate to the official business
> of Weatherbeeta must be treated as neither given nor endorsed by
> Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall
> not be liable for direct, indirect or consequential loss arising from
> transmission of this message or any attachments
In response to
pgsql-novice by date
|Next:||From: Tom Lane||Date: 2007-05-06 00:34:42|
|Subject: Re: Importing a CSV file to a table on Postgres |
|Previous:||From: Tom Lane||Date: 2007-05-04 14:37:29|
|Subject: Re: Trigger and Notify |