[SQL] how to preserve \n in select statement

2003-12-19 Thread Matt Van Mater
I have a table that has a few text value types, and I enter a bunch of text with '\n' representing a newline. When I select the records from that table, postgresql 7.3 represents those \n as newlines and actually outputs the a newline rather than as a \n as entered. I want to be able to get

[SQL] testing for null value in integer field?

2003-12-19 Thread Geoffrey
How does one check for an unset value in an integer field? I've tried such things as: select . where intnumber = '' select .. where intnumber = ? select . where intnumber = NULL Thanks. -- Until later, Geoffrey [EMAIL PROTECTED] Building secure systems inspite of Microsoft

Re: [SQL] testing for null value in integer field?

2003-12-19 Thread Wei Weng
Geoffrey wrote: How does one check for an unset value in an integer field? I've tried such things as: select . where intnumber = '' select .. where intnumber = ? select . where intnumber = NULL Thanks. It is actually WHERE intnumber IS NULL. You don't use operator = to compare

Re: [SQL] testing for null value in integer field?

2003-12-19 Thread Guy Fraser
select . where intnumber IS NULL Geoffrey wrote: How does one check for an unset value in an integer field? I've tried such things as: select . where intnumber = '' select .. where intnumber = ? select . where intnumber = NULL Thanks. ---(end of

Re: [SQL] testing for null value in integer field?

2003-12-19 Thread Geoffrey
Wei Weng wrote: Geoffrey wrote: How does one check for an unset value in an integer field? I've tried such things as: select . where intnumber = '' select .. where intnumber = ? select . where intnumber = NULL Thanks. It is actually WHERE intnumber IS NULL. You don't use operator

Re: [SQL] how to preserve \n in select statement

2003-12-19 Thread Matt Van Mater
I have been entering the data by having a command file that inserts the rows one by one. (yes I know a copy command would probably be faster for importing bulk data, but I prefer to insert each line individually) IE: psql -U myusername mydatabase -f '/path/to/commandfile' Inside the

Re: [SQL] how to preserve \n in select statement

2003-12-19 Thread Bruno Wolff III
On Fri, Dec 19, 2003 at 10:06:28 -0500, Matt Van Mater [EMAIL PROTECTED] wrote: I have a table that has a few text value types, and I enter a bunch of text with '\n' representing a newline. When I select the records from that table, postgresql 7.3 represents those \n as newlines and

Re: [SQL] how to preserve \n in select statement

2003-12-19 Thread Matt Van Mater
I just don't see why pgsql can't return my data exactly as I entered it. It wouldn't be hard for me to manipulate it before entry and add another escape character, but that's not really the point. The point is why is postgresql changing the data I insert into a field, and not giving me away

Re: [SQL] how to preserve \n in select statement

2003-12-19 Thread Tom Lane
Matt Van Mater [EMAIL PROTECTED] writes: I just don't see why pgsql can't return my data exactly as I entered it. Because you are using an input syntax that requires that quotes and backslashes be escaped. There are other input methods available that don't require this, but they have