Re: [GENERAL] Moving the database from winxp to linux

2007-01-11 Thread Ireneusz Pluta
Tomas Lanczos napisał(a): Thanks. No complications due the move to the higher version (8.2)? Tomas Per usual remarks about upgrading found in installation instructions of every release, you will need to use pg_dump that comes with the new version to connect to the old database and run

Re: [GENERAL] Foreign Key Identification

2007-01-11 Thread Ashish Karalkar
Thank You Guys, For your valuable suggestions. Out of the suggestion to investigate in to PG_depane was cumbersome , yes there is a view in information schema called information_schema.referential_constraints which gives same details in terms of foreign keys and primary keys and is usefull if u

[GENERAL] Knowing the length(convert(username using windows_1251_to_utf8))

2007-01-11 Thread Alexander Farber
Hello PostgreSQL users! I have this data stored in WIN1251 encoding, which is being fetched by a libpq application I'm developing: phpbb= show client_encoding; - WIN1251 (1 row) phpbb= \d phpbb_users; username | character varying(25) | not null default

Re: [GENERAL] Knowing the length(convert(username using windows_1251_to_utf8))

2007-01-11 Thread Alexander Farber
And additional question please: Can I still be sure that the data returned in the convert(username using windows_1251_to_utf8) column will be 0-terminated or should I fetch the data length using PQgetlength and maintain that value in my C-program? Thank you Alex On 1/11/07, Alexander Farber

Re: [GENERAL] Postgres Replication

2007-01-11 Thread Shane Ambler
dcrespo wrote: Good question. The only concern that I have is the date of the last version (2005-3-7). You will find that their website has not been updated for a while. If you look in pgfoundry you will find that they have releases as recent as a few days ago. The different 1.x versions

Re: [GENERAL] PG compilation

2007-01-11 Thread Shane Ambler
km wrote: Hi, I would like to know if there is a way to pass an argument to ./configure to consider compiling with a specific python version ? coz i have many python versions in the system .I presume that configure would check for the /usr/bin/python alone, but what if i want

Re: [GENERAL] Recording insert, updates, and deletes

2007-01-11 Thread Andy Dale
Hi, I turned on the stats_row_level in the postgresql.conf file and now the the calls to the stats functions work. I want to get the inserted, updated, and deleted numbers on a given database, so i have written a query to do so: SELECT sum(pg_stat_get_tuples_inserted(c.oid)) AS inserted,

Re: [GENERAL] Recording insert, updates, and deletes

2007-01-11 Thread Richard Huxton
Andy Dale wrote: Hi, I turned on the stats_row_level in the postgresql.conf file and now the the calls to the stats functions work. I want to get the inserted, updated, and deleted numbers on a given database, so i have written a query to do so: SELECT

[GENERAL] Cluster all tables in database to PK index

2007-01-11 Thread Hannes Dorbath
Besides writing a script that looks through the DDL of all tables, and CLUSTERs all tables with PK constraints, is there a quicker way? Thanks. -- Regards, Hannes Dorbath ---(end of broadcast)--- TIP 4: Have you searched our list archives?

Re: [GENERAL] Knowing the length(convert(username using windows_1251_to_utf8))

2007-01-11 Thread Martijn van Oosterhout
On Thu, Jan 11, 2007 at 10:19:38AM +0100, Alexander Farber wrote: Hello PostgreSQL users! I have this data stored in WIN1251 encoding, which is being fetched by a libpq application I'm developing: snip phpbb= select username, length(username), length(convert(username using

Re: [GENERAL] Recording insert, updates, and deletes

2007-01-11 Thread Andy Dale
Sorry for being stupid, you can select the table info from the pg_class table, so i can ignore the information schema. If the stats collector is 'lossy ' i will not be able to use it, can anyone confirm that it is ? So maybe my best option is to write a simple trigger that just increments a

Re: [GENERAL] Recording insert, updates, and deletes

2007-01-11 Thread Martijn van Oosterhout
On Thu, Jan 11, 2007 at 11:46:17AM +0100, Andy Dale wrote: If the stats collector is 'lossy ' i will not be able to use it, can anyone confirm that it is ? So maybe my best option is to write a simple trigger that just increments a counter (value in a separate table) after an

[GENERAL] Optimize expresiions.

2007-01-11 Thread han . holl
Hello, Given a table: create table atable ( item integer; ); and a view: create view aview as select item, very_expensive_function(item) as exp, cheap_function(item) as cheap from atable; Now the query: select item from aview where exp 0 and cheap 0; will lead to a sequential scan on

Re: [GENERAL] PG compilation

2007-01-11 Thread km
I would like to know if there is a way to pass an argument to ./configure to consider compiling with a specific python version ? coz i have many python versions in the system .I presume that configure would check for the /usr/bin/python alone, but what if i want /usr/bin/python2.5 to be

Re: [GENERAL] PG compilation

2007-01-11 Thread Peter Eisentraut
km wrote: I would like to know if there is a way to pass an argument to ./configure to consider compiling with a specific python version ? configure PYTHON=/usr/bin/python2.5 -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of

Re: [GENERAL] Optimize expresiions.

2007-01-11 Thread Richard Huxton
[EMAIL PROTECTED] wrote: Now the query: select item from aview where exp 0 and cheap 0; will lead to a sequential scan on atable with filter: very_expensive_function(item) 0 and cheap_function(item) 0 The query would run much faster with the filter reordered. Is there a way to tell the

Re: [GENERAL] Knowing the length(convert(username using windows_1251_to_utf8))

2007-01-11 Thread Alexander Farber
Hi Martijn, On 1/11/07, Martijn van Oosterhout kleptog@svana.org wrote: If you need the string in UTF-8, why not just set the client_encoding to utf8 and then the server will only send you strings in utf8, not conversion necessary. actually you are right, because I need all my data in UTF8

Re: [GENERAL] TRIGGER BEFORE INSERT

2007-01-11 Thread Rafal Pietrak
Hi! I'm re-posting this message again in hope someone would have a look at the case again. .. it's pending. In postgres v7.2 I had a trigger function launched BEFORE INSERT, which did everything I needed (like an UPDATE of other table inside of that trigger function, and adjustment of the

Re: [GENERAL] Optimize expresiions.

2007-01-11 Thread han . holl
On Thursday 11 January 2007 12:34, Richard Huxton wrote: The query would run much faster with the filter reordered. Is there a way to tell the planner/optimizer that certain functions are more expensive than others, and should be postponed in lazy evaluation ? Or is there a hook in the

Re: [GENERAL] Knowing the length(convert(username using windows_1251_to_utf8))

2007-01-11 Thread Martijn van Oosterhout
On Thu, Jan 11, 2007 at 12:37:32PM +0100, Alexander Farber wrote: May I ask you an off-topic question? I've read several docs on Unicode, but they are difficult to understand. Have you read the Unicode FAQ? http://www.cl.cam.ac.uk/~mgk25/unicode.html Do you think that an UTF8 string will

Re: [GENERAL] Optimize expresiions.

2007-01-11 Thread Adam Rich
How about this? select item, very_expensive_function(item) as exp, cheap from ( Select item, cheap_function(item) as cheap From atable where cheap_function(item) 0 ) sub where very_expensive_function(item) 0 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [GENERAL] TRIGGER BEFORE INSERT

2007-01-11 Thread Martijn van Oosterhout
On Thu, Jan 11, 2007 at 01:01:24PM +0100, Rafal Pietrak wrote: Hi! I'm re-posting this message again in hope someone would have a look at the case again. .. it's pending. Well, I can't help with the details because I can't see what you're trying to do, but I'm fairly sure you can't change

Re: [GENERAL] TRIGGER BEFORE INSERT

2007-01-11 Thread Alban Hertroys
Rafal Pietrak wrote: Hi! I'm re-posting this message again in hope someone would have a look at the case again. .. it's pending. You were given a solution; defer the foreign key constraint. Alternatively, you may want to re-think your trigger function so that it does things in the right

Re: [GENERAL] Problems With VIEWS

2007-01-11 Thread Jeanna Geier
Once again, thanks for the help. OK, so I did the Adam's suggestion: SELECT * FROM pg_rules and got the following returned: apt=# select * from pg_rules; schemaname | tablename | rulename| definition

Re: [GENERAL] Optimize expresiions.

2007-01-11 Thread Alban Hertroys
[EMAIL PROTECTED] wrote: On Thursday 11 January 2007 12:34, Richard Huxton wrote: The query would run much faster with the filter reordered. Is there a way to tell the planner/optimizer that certain functions are more expensive than others, and should be postponed in lazy evaluation ? Or is

Re: [GENERAL] Problems With VIEWS

2007-01-11 Thread Richard Broersma Jr
So, herein probably lies my problem with the Cannont insert into a view error I'm getting anytime I'm attempting to access it from my program - there are no rules set up for them, right? Correct, without insert rules you will not be able to add new records to the underlying tables of a view.

Re: [GENERAL] Problems With VIEWS

2007-01-11 Thread Bernd Helmle
On Thu, 11 Jan 2007 06:36:34 -0800 (PST), Richard Broersma Jr [EMAIL PROTECTED] wrote: Either way. I like to create sql files with all of the DDL for creating the view and rules. Overtime, if I need to change my view or reconfigure the rules, I can edit my sql file and then call it up

Re: [GENERAL] Problems With VIEWS

2007-01-11 Thread Russell Smith
Bernd Helmle wrote: On Thu, 11 Jan 2007 06:36:34 -0800 (PST), Richard Broersma Jr [EMAIL PROTECTED] wrote: Either way. I like to create sql files with all of the DDL for creating the view and rules. Overtime, if I need to change my view or reconfigure the rules, I can edit my sql file

Re: [GENERAL] Cluster all tables in database to PK index

2007-01-11 Thread Scott Ribe
Besides writing a script that looks through the DDL of all tables, and CLUSTERs all tables with PK constraints, is there a quicker way? Is this really a sensible thing to do? As often as not, you want to cluster on foreign keys... -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/

[GENERAL] crosstab - pivot - transpose

2007-01-11 Thread SunWuKung
Hi, I will need to create a crosstab representation of my resultset. The resultset looks like this: rowid, columnid, cellvalue I don't know beforehand the number of columns and their id's but they will be close to 200. I have looked at the crosstab tablefunction but it seems that you have to know

[GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Patrick Earl
Hi all. I'm getting a checkpoint request failed message when I try to execute a CREATE DATABASE command. Since it was a fresh install, I've included the entire server log up to the point of the error. I truncated the log output two lines after the error message. Is there a way I can avoid

[GENERAL] Remove duplicate rows

2007-01-11 Thread Jiří Němec
Hello, I need to remove duplicates rows from a subquery but order these results by a column what is not selected. There are logically two solutions but no works. SELECT DISTINCT sub.foo FROM (SELECT ...) AS sub ORDER BY sub.bar ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in

Re: [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Tom Lane
Patrick Earl [EMAIL PROTECTED] writes: 2007-01-11 09:56:17 ERROR: could not open relation 1663/16403/16426: Permission denied 2007-01-11 09:56:17 ERROR: checkpoint request failed 2007-01-11 09:56:17 HINT: Consult recent messages in the server log for details. 2007-01-11 09:56:17

Re: [GENERAL] Remove duplicate rows

2007-01-11 Thread Russell Smith
Jiří Němec wrote: Hello, I need to remove duplicates rows from a subquery but order these results by a column what is not selected. There are logically two solutions but no works. SELECT DISTINCT sub.foo FROM (SELECT ...) AS sub ORDER BY sub.bar ERROR: for SELECT DISTINCT, ORDER BY

Re: [GENERAL] TRIGGER BEFORE INSERT

2007-01-11 Thread Rafal Pietrak
On Thu, 2007-01-11 at 15:10 +0100, Alban Hertroys wrote: Rafal Pietrak wrote: Hi! I'm re-posting this message again in hope someone would have a look at the case again. .. it's pending. You were given a solution; defer the foreign key constraint. Well. I were, but probably I'm

Re: [GENERAL] TRIGGER BEFORE INSERT

2007-01-11 Thread Martijn van Oosterhout
On Thu, Jan 11, 2007 at 07:26:32PM +0100, Rafal Pietrak wrote: Well. I were, but probably I'm doing something wrong with 'deferring the trigger'. When I put: SET CONSTRAINTS ALL DEFERRED ; *before* the UPDATE statement *within* the trigger function (just after BEGIN statement there).

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Bruce Momjian
Tom Lane wrote: Michael Glaesemann [EMAIL PROTECTED] writes: On Dec 26, 2006, at 18:39 , Mike Benoit wrote: ERROR: ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of the result columns Even though state is a column in both tables, the order by is using an expression,

Re: [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Patrick Earl
We're getting the error as part of an automated test suite and it is seems to occur every time the suite is run. The platform is Win XP 64 bit. When running the same unit test suite from a remote machine, the error does not occur. The error also does not occur when manually running the create

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Mike Benoit
On Thu, 2007-01-11 at 13:44 -0500, Bruce Momjian wrote: Tom Lane wrote: Michael Glaesemann [EMAIL PROTECTED] writes: On Dec 26, 2006, at 18:39 , Mike Benoit wrote: ERROR: ORDER BY on a UNION/INTERSECT/EXCEPT result must be on one of the result columns Even though state is a

Re: [GENERAL] Trying to load MySQL data

2007-01-11 Thread Merlin Moncure
On 1/10/07, Dimitri Fontaine [EMAIL PROTECTED] wrote: Hi, Le mercredi 10 janvier 2007 02:54, [EMAIL PROTECTED] a écrit: I am working on a project where we are converting from MySQL to Postgres. I figured the easiest way would be to export the MySQL data as CSV. If you are using pg 8.2+,

[GENERAL] generate_series with month intervals

2007-01-11 Thread Marcus Engene
Hi list, I'd like to generate the latest year dynamically with generate_series. This select works day wise: select date_trunc ('month', now())::date + s.a from generate_series(0, 11) as s(a) I tried this but it didn't work: select date_trunc ('month', now())::date + interval s.a || ' months'

[GENERAL] pg_standby testing notes

2007-01-11 Thread Merlin Moncure
I am looking into using pg_standby (v3) in a warm standby system. I'm going to double check it, but same machine replication seemed to work ok. When I tried to do remote server log shipping however, I had some issues. Initial setup and launch is working ok, my archive command is: 'test ! -f

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Bruce Momjian
Mike Benoit wrote: That helps some, but I'm sure it could be even more clear. The main issue is that you can't order by an expression computed by unions, correct? So couldn't the error message by something like: ORDER BY on a UNION/INTERSECT/EXCEPT result must match existing result

Re: [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Tom Lane
Patrick Earl [EMAIL PROTECTED] writes: We're getting the error as part of an automated test suite and it is seems to occur every time the suite is run. The platform is Win XP 64 bit. Hm. We've seen problems of this ilk caused by bogus antivirus software, but if that were the explanation it's

Re: [GENERAL] Trying to load MySQL data

2007-01-11 Thread Bruce Momjian
Merlin Moncure wrote: On 1/10/07, Dimitri Fontaine [EMAIL PROTECTED] wrote: Hi, Le mercredi 10 janvier 2007 02:54, [EMAIL PROTECTED] a ?crit: I am working on a project where we are converting from MySQL to Postgres. I figured the easiest way would be to export the MySQL data as

Re: [GENERAL] Trying to load MySQL data

2007-01-11 Thread Merlin Moncure
On 1/11/07, Bruce Momjian [EMAIL PROTECTED] wrote: Merlin Moncure wrote: On 1/10/07, Dimitri Fontaine [EMAIL PROTECTED] wrote: Hi, Le mercredi 10 janvier 2007 02:54, [EMAIL PROTECTED] a ?crit: I am working on a project where we are converting from MySQL to Postgres. I figured the

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Well, it can be an expression _if_ the expression _matches_ an existing UNION column. You're mistaken. It has to be *an output column name*. Not anything else. regards, tom lane ---(end of

Re: [GENERAL] TRIGGER BEFORE INSERT

2007-01-11 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: On Thu, Jan 11, 2007 at 07:26:32PM +0100, Rafal Pietrak wrote: So may be SET CONSTRAINTS DEFERRED should be used somehow differently? I've never had any use for that construct, may be I miss something? Only at the beginning of a

Re: [GENERAL] ERROR: invalid memory alloc request size, and others

2007-01-11 Thread Jonathan Hedstrom
Jonathan Hedstrom wrote: We downloaded the most recent stock FC6 kernel and rebooted to that. Hopefully this will take care of the issue. We've been up and running for 2 days now on the stock kernel, and haven't seen any of these errors. I'm thinking the issue is resolved. Thanks again for all

Re: [GENERAL] generate_series with month intervals

2007-01-11 Thread Tom Lane
Marcus Engene [EMAIL PROTECTED] writes: I tried this but it didn't work: select date_trunc ('month', now())::date + interval s.a || ' months' from generate_series(0, 11) as s(a) People keep trying that :-(. The typename 'foo' syntax is for a *literal constant* only. Instead use

Re: [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Patrick Earl
There is no antivirus software running on the machine. I'm not entirely sure how to determine which relation it is complaining about. I see a folder that corresponds to the middle number in the log, and I see numbers in the same range as the right number from the log. In any case, the unit

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Well, it can be an expression _if_ the expression _matches_ an existing UNION column. You're mistaken. It has to be *an output column name*. Not anything else. Yea, I was thinking of this: SELECT *, state IS NULL AS

Re: [GENERAL] Remove duplicate rows

2007-01-11 Thread Bruno Wolff III
On Thu, Jan 11, 2007 at 18:51:57 +0100, Jiří Němec [EMAIL PROTECTED] wrote: Hello, I need to remove duplicates rows from a subquery but order these results by a column what is not selected. There are logically two solutions but no works. SELECT DISTINCT sub.foo FROM (SELECT ...) AS sub

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Updated wording: test= select * from test union select * from test order by x is null; ERROR: A UNION/INTERSECT/EXCEPT ORDER BY cannot use expressions or functions, only result column names This does not meet the style guidelines.

Re: [GENERAL] generate_series with month intervals

2007-01-11 Thread Marcus Engene
Tom Lane skrev: Marcus Engene [EMAIL PROTECTED] writes: I tried this but it didn't work: select date_trunc ('month', now())::date + interval s.a || ' months' from generate_series(0, 11) as s(a) People keep trying that :-(. The typename 'foo' syntax is for a *literal constant* only.

Re: [GENERAL] Problems With VIEWS

2007-01-11 Thread Jeanna Geier
Thanks, everyone - I really appreciate everyone's inupt and responses! Got this resolved and added the RULES to my .sql file. So far, so good. -Jeanna -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bernd Helmle Sent: Thursday, January 11, 2007 9:02 AM

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Alvaro Herrera
Bruce Momjian wrote: Here the column result is an expression, and you reference that. Updated wording: test= select * from test union select * from test order by x is null; ERROR: A UNION/INTERSECT/EXCEPT ORDER BY cannot use expressions or functions, only result column names This

Re: [GENERAL] TRIGGER BEFORE INSERT

2007-01-11 Thread Adrian Klaver
On Thursday 11 January 2007 10:26 am, Rafal Pietrak wrote: On Thu, 2007-01-11 at 15:10 +0100, Alban Hertroys wrote: Rafal Pietrak wrote: Hi! I'm re-posting this message again in hope someone would have a look at the case again. .. it's pending. You were given a solution; defer

Re: [GENERAL] generate_series with month intervals

2007-01-11 Thread Bruno Wolff III
On Thu, Jan 11, 2007 at 20:07:29 +0100, Marcus Engene [EMAIL PROTECTED] wrote: Hi list, I'd like to generate the latest year dynamically with generate_series. This select works day wise: This works but looks grotesque: select distinct date_trunc ('month', now()::date + s.a)::date

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Updated wording: test= select * from test union select * from test order by x is null; ERROR: A UNION/INTERSECT/EXCEPT ORDER BY cannot use expressions or functions, only result column names This does not meet the style

[GENERAL] RESTORE Error

2007-01-11 Thread Jeanna Geier
Hi List! I'm attempting to do a restore of a database and I'm getting the following error the I'm not familiar with: COPY workorder (work_order_id, projectname, request_date, requestor, request_detail, request_completion_date, request_a... pg_restore: restoring data for table worksite

Re: [GENERAL] TRIGGER BEFORE INSERT

2007-01-11 Thread Rafal Pietrak
Perfect! Thenx! -R On Thu, 2007-01-11 at 12:26 -0800, Adrian Klaver wrote: On Thursday 11 January 2007 10:26 am, Rafal Pietrak wrote: On Thu, 2007-01-11 at 15:10 +0100, Alban Hertroys wrote: Rafal Pietrak wrote: Hi! I'm re-posting this message again in hope someone would have a

Re: [GENERAL] RESTORE Error

2007-01-11 Thread Jeanna Geier
Just a bit more info: Running Postgres 8.0 and the: 255454 3 WestSalem 2006-05-12 14:10:18.578-05 greg clean it 2006-05-12 17:00:00-05 W6037 Ruth Lane OnalaskaWisconsin 54650 ... is a row (the first row) that should be inserted/restored into the

[GENERAL] documentation vs reality: template databases

2007-01-11 Thread Richard P. Welty
running 8.1 on a fedora core 5 linux box, up to date so far as i know. this page: http://www.postgresql.org/docs/8.1/interactive/manage-ag-templatedbs.html says the following: Note: template1 and template0 do not have any special status beyond the fact that the name template1 is the

Re: [GENERAL] ORDER BY col is NULL in UNION causes error?

2007-01-11 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Where are the style guidelines? I looked before but can't find them. http://developer.postgresql.org/pgdocs/postgres/error-style-guide.html regards, tom lane ---(end of

Re: [GENERAL] RESTORE Error

2007-01-11 Thread Jeanna Geier
And log file shows the following (what I posted before was through pgAdmin): 2007-01-11 15:38:17 LOG: could not load root certificate file C:/Program Files/PostgreSQL/8.0/data/root.crt: No such file or directory 2007-01-11 15:38:17 DETAIL: Will not verify client certificates. 2007-01-11

Re: [GENERAL] remove embedded carriage returns

2007-01-11 Thread chwy_nougat
[EMAIL PROTECTED] wrote: Outputting a SELECT statement's results to ascii file showed me a table with a bunch of embedded carriage return characters in the values. I want to remove the embedded returns, so I read the documentation and tried a few variations on SELECT replace(columname,

[GENERAL] Question - Query based on WHERE OR

2007-01-11 Thread Mike Poe
I'm a rank newbie to Postgres am having a hard time getting my arms around this. I'm trying to construct a query to be run in a PHP script. I have an HTML form were someone can enter either a last name or a social security number then query the database based on what they entered. My query

Re: [GENERAL] remove embedded carriage returns

2007-01-11 Thread Kj
Jonathan Hedstrom wrote: [EMAIL PROTECTED] wrote: SELECT replace(columname, 'chr(13)','') from tablename Try using chr(13) without the single quotes: SELECT replace(columname, chr(13),'') from tablename or you could use '\r' to get the character: SELECT replace(columname, E'\r','')

[GENERAL] storing SMALL large objects to postgres with C# (.NET ODBC layer)

2007-01-11 Thread NM
Hello, I've got a problem inserting binary objects into the postgres database. I have binary objects (e.g. images or smth else) of any size which I want to insert into the database. Funny is it works for files larger than 8000 Bytes. If a file is less than 1000 Bytes I get the following message:

Re: [GENERAL] Trying to load MySQL data

2007-01-11 Thread [EMAIL PROTECTED]
The missing quote after Poster is a mistake I made when sanitzing the data for posting here. That error is NOT present in the actual data. There is a quote where needed in the data. So, with that in mind, why am I still getting the error? Also, there is no symbol we can expect to not be in the

Re: [GENERAL] RESTORE Error

2007-01-11 Thread Jeanna Geier
OK, so if there are several of these same types of errors (which I verified by running the RESTORE from the command line vs. pgAdmin - some with \ and some with the OID; how come it exits out on that one particulat one?? Any thoughts or ideas on that one?: COPY profession_type (projectname,

Re: [GENERAL] Trying to load MySQL data

2007-01-11 Thread Scott Marlowe
On Wed, 2007-01-10 at 16:51, [EMAIL PROTECTED] wrote: The missing quote after Poster is a mistake I made when sanitzing the data for posting here. That error is NOT present in the actual data. There is a quote where needed in the data. So, with that in mind, why am I still getting the error?

[GENERAL] Function which returns record

2007-01-11 Thread dparent
I am looking to have the select list passed into a function at runtime and use this select list to build SQL to execute, for example: CREATE or REPLACE FUNCTION public.test2( IN _sfieldlist varchar) RETURNS SETOF pg_catalog.record AS $BODY$ DECLARE v_feed RECORD; v_sfieldlist

Re: [GENERAL] pg_standby testing notes

2007-01-11 Thread Simon Riggs
On Thu, 2007-01-11 at 14:20 -0500, Merlin Moncure wrote: I am looking into using pg_standby (v3) in a warm standby system. I'm going to double check it, but same machine replication seemed to work ok. When I tried to do remote server log shipping however, I had some issues. Initial setup

Re: [GENERAL] Question - Query based on WHERE OR

2007-01-11 Thread John D. Burger
Mike Poe wrote: SELECT foo, baz, bar FROM public.table WHERE lastname ~* '$lastname' OR ssn='$ssn' I need to leave the last name a wildcard in case someone enters a partial name, lower case / upper case, etc. I want the SSN to match exactly if they search by that. The way it's written, if

Re: [GENERAL] Question - Query based on WHERE OR

2007-01-11 Thread SCassidy
You could have your program check to see if the lastname form field was empty, and send different queries to the database depending on what they entered. I'm a perl person, not php, so my php syntax might not be perfect, but you'll get the idea: if ($lastname ==) { $query=SELECT foo, baz,

Re: [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Tom Lane
Patrick Earl [EMAIL PROTECTED] writes: In any case, the unit tests remove all contents and schema within the database before starting, and they remove the tables they create as they proceed. Certainly there are many things have been recently deleted. Yeah, I think then there's no question

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Magnus Hagander
Tom Lane wrote: Patrick Earl [EMAIL PROTECTED] writes: In any case, the unit tests remove all contents and schema within the database before starting, and they remove the tables they create as they proceed. Certainly there are many things have been recently deleted. Yeah, I think then

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: I find it very unlikely that you would during normal operations end up in a situation where you would first have permissions to create files in a directory, and then lose them. What could be is that you have a directory where you never had permissions

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Jim C. Nasby
On Thu, Jan 11, 2007 at 03:14:37PM -0500, Tom Lane wrote: The downside of this is that a real EACCES problem wouldn't get noted at any level higher than LOG, and so you could theoretically lose data without much warning. But I'm not seeing anything else we could do about it --- AFAIK we have

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Tom Lane
Jim C. Nasby [EMAIL PROTECTED] writes: Given that this could result in data loss, if this was to be done I'd very much want to see a way to disable it in a production environment. Production environments are the same ones that won't be happy with random checkpoint failures, either. If we can't

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Magnus Hagander
Tom Lane wrote: Magnus Hagander [EMAIL PROTECTED] writes: I find it very unlikely that you would during normal operations end up in a situation where you would first have permissions to create files in a directory, and then lose them. What could be is that you have a directory where you never

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Jim C. Nasby
On Thu, Jan 11, 2007 at 04:32:42PM -0500, Tom Lane wrote: Jim C. Nasby [EMAIL PROTECTED] writes: Given that this could result in data loss, if this was to be done I'd very much want to see a way to disable it in a production environment. Production environments are the same ones that won't

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Richard Troy
On Thu, 11 Jan 2007, Tom Lane wrote: ...snip... (You know, of course, that my opinion is that no sane person would run a production database on Windows in the first place. So the data-loss risk to me seems less of a problem than the unexpected-failures problem. It's not like there aren't a

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Andrew Dunstan
Richard Troy wrote: On Thu, 11 Jan 2007, Tom Lane wrote: ...snip... (You know, of course, that my opinion is that no sane person would run a production database on Windows in the first place. So the data-loss risk to me seems less of a problem than the unexpected-failures problem. It's not

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Joshua D. Drake
Please don't. At least not on the PostgreSQL web site nor in the docs. And no, I don't run my production servers on Windows either. It does seem like it might be a good idea to have FAQs based on each OS, yes? There are various things that effect each OS differently. The most

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread jam
On Thu, Jan 11, 2007 at 03:12:07PM -0800, Joshua D. Drake wrote: It does seem like it might be a good idea to have FAQs based on each OS, yes? There are various things that effect each OS differently. The most obvious to me being shared memory and wal_sync_method. If could be a good idea to

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Alvaro Herrera
Joshua D. Drake wrote: Please don't. At least not on the PostgreSQL web site nor in the docs. And no, I don't run my production servers on Windows either. It does seem like it might be a good idea to have FAQs based on each OS, yes? There are various things that effect each OS

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread jam
On Thu, Jan 11, 2007 at 09:42:38PM -0300, Alvaro Herrera wrote: But we have per-platform FAQs. If there is information missing, the reason is that nobody has submitted an appropriate patch, nothing more. where are these FAQs, and why were they not easily found when the original poster sent

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Joshua D. Drake
On Thu, 2007-01-11 at 21:42 -0300, Alvaro Herrera wrote: Joshua D. Drake wrote: Please don't. At least not on the PostgreSQL web site nor in the docs. And no, I don't run my production servers on Windows either. It does seem like it might be a good idea to have FAQs based on each

Re: [GENERAL] documentation vs reality: template databases

2007-01-11 Thread Chris
Richard P. Welty wrote: running 8.1 on a fedora core 5 linux box, up to date so far as i know. this page: http://www.postgresql.org/docs/8.1/interactive/manage-ag-templatedbs.html says the following: Note: template1 and template0 do not have any special status beyond the fact that the

[GENERAL] Corrupt database? 8.1/FreeBSD6.0

2007-01-11 Thread Jeff Amiel
PostgreSQL 8.1.2 on i386-portbld-freebsd6.0, compiled by GCC cc (GCC) 3.4.4 [FreeBSD] 20050518 Started seeing this in the logs this afternoon...scaring the begeezus out of me. Jan 11 19:20:19 prod-app-1 postgres[1752]: [5-1] 1752 ERROR: could not access status of transaction 1924023481 Jan

Re: [GENERAL] Corrupt database? 8.1/FreeBSD6.0

2007-01-11 Thread Jeff Amiel
Looking backwards in the logs we see it a few other times this month... (Autovacuum occurring just prior)...same transaction ID How could it be the same transaction ID from several days prior? Jan 2 03:05:04 prod-app-1 postgres[8524]: [4-1] 8524 LOG: autovacuum: processing database template0

Re: [GENERAL] RESTORE Error

2007-01-11 Thread Tom Lane
Jeanna Geier [EMAIL PROTECTED] writes: And log file shows the following (what I posted before was through pgAdmin): 2007-01-11 15:38:47 ERROR: relation temp_measurement does not exist 2007-01-11 15:38:47 ERROR: syntax error at or near 7094982 at character 1 2007-01-11 15:38:47 ERROR: syntax

Re: [HACKERS] [GENERAL] Checkpoint request failed on version 8.2.1.

2007-01-11 Thread Tom Lane
Jim C. Nasby [EMAIL PROTECTED] writes: On Thu, Jan 11, 2007 at 03:14:37PM -0500, Tom Lane wrote: ... And anyway there should never *be* a real permissions problem; if there is then the user's been poking under the hood sufficient to void the warranty anyway ;-) Or some other helpful process

Re: [GENERAL] Corrupt database? 8.1/FreeBSD6.0

2007-01-11 Thread Tom Lane
Jeff Amiel [EMAIL PROTECTED] writes: PostgreSQL 8.1.2 on i386-portbld-freebsd6.0, compiled by GCC cc (GCC) 3.4.4 [FreeBSD] 20050518 Jan 2 03:05:04 prod-app-1 postgres[8524]: [4-1] 8524 LOG: autovacuum: processing database template0 Jan 2 03:05:05 prod-app-1 postgres[8524]: [5-1] 8524

Re: [GENERAL] Corrupt database? 8.1/FreeBSD6.0

2007-01-11 Thread Tom Lane
Jeff Amiel [EMAIL PROTECTED] writes: We've downloaded/compiled pg_filedump, but are stumped as to what relation (or even what database) to start with. Turn up log_min_messages to DEBUG2 and you'll be able to see which table autovac is failing at. If I had to bet I'd bet on

[GENERAL] Select Query

2007-01-11 Thread Ashish Karalkar
Hello List, I am having list of tables , what I want to do is to filter this list of table for a particular value of its column, the column which i will be searching is common accross all tables in list any clues?? With regards Ashish Karalkar

Re: [GENERAL] Select Query

2007-01-11 Thread Shane Ambler
Ashish Karalkar wrote: Hello List, I am having list of tables , what I want to do is to filter this list of table for a particular value of its column, the column which i will be searching is common accross all tables in list any clues?? Something like SELECT * FROM ( SELECT

  1   2   >