[GENERAL] Single missing WAL in long sequence..

2009-03-23 Thread Aimon Bustardo
Hi, I ran into a recovery problem where I have a single missing WAL file in a long sequence. I need a way to recover past that missing WAL archive. I am desperately hoping there is a way to do this. Any help that can be given will be extremely appreciated! Thanks! Aimon -- Sent via p

Re: [GENERAL] Determining/Setting a server's time zone

2009-03-23 Thread Tom Lane
Madison Kelly writes: >Server (PostgreSQL 8.1): > $ date > Mon Mar 23 20:07:20 EDT 2009 > db=> show timezone; > TimeZone > -- > GMT > (1 row) Hmm. Apparently, this machine is configured so that TZ is set properly in the environment of user login processes (perhaps in /etc/profil

Re: [GENERAL] Determining/Setting a server's time zone

2009-03-23 Thread Scott Marlowe
On Mon, Mar 23, 2009 at 6:14 PM, Madison Kelly wrote: > Tom Lane wrote: >> >> Madison Kelly writes: >>> >>>   How/Where does PostgreSQL set or determine the local time zone? >> >> Well, "show timezone" will tell you what PG is using.  Where it came >> from is a bit harder to answer.  The default

Re: [GENERAL] Determining/Setting a server's time zone

2009-03-23 Thread Madison Kelly
Tom Lane wrote: Madison Kelly writes: How/Where does PostgreSQL set or determine the local time zone? Well, "show timezone" will tell you what PG is using. Where it came from is a bit harder to answer. The default is to use whatever zone is current according to the postmaster's startup e

Re: [GENERAL] Last modification time of a database?

2009-03-23 Thread Craig Ringer
Erik Jones wrote: Am I missing something obvious here? If not, has anyone come up with a reliable way to do this? Triggers on all your tables that append to a logging table? Have the client do it? Note that you do *NOT* want to have triggers that attempt to UPDATE a table to record the

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Craig Ringer
RebeccaJ wrote: And I wonder why you like SQL_ASCII better than UTF8, and whether others have any opinions about those two. (My web server's LC_CTYPE is C, so I can use any character set.) Wouldn't UTF8 allow more characters than SQL_ASCII? I've had a LOT of experience dealing with apps that u

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Alban Hertroys
On Mar 23, 2009, at 10:11 PM, RebeccaJ wrote: On Mar 22, 12:36 pm, scott.marl...@gmail.com (Scott Marlowe) wrote: ayup. As long as they're legal for your encoding, they'll go right in. If you wanna stuff in anything no matter the encoding, use a database initialized for SQL_ASCII encoding.

Re: [GENERAL] Determining/Setting a server's time zone

2009-03-23 Thread Tom Lane
Madison Kelly writes: >How/Where does PostgreSQL set or determine the local time zone? Well, "show timezone" will tell you what PG is using. Where it came from is a bit harder to answer. The default is to use whatever zone is current according to the postmaster's startup environment, and th

Re: [GENERAL] 1- and 2-dimensional indexes on same column: why is the 2d one preferred?

2009-03-23 Thread Tom Lane
Marinos Yannikos writes: > Recent versions of PostgreSQL seem to prefer 2d indexes somehow: > for a table "foo" with > "i_a" btree (a) > "i_ab" btree (a, b) > SELECT * FROM foo WHERE a=123 > will often use "i_ab" and not "i_a" (even right after ANALYZE). I suspect that these indexes are exactly

Re: [GENERAL] libpq -- reading a timestamp with time zone using binary format

2009-03-23 Thread Whit Armstrong
Thanks, Tom. That's just what I needed. -Whit On Mon, Mar 23, 2009 at 7:15 PM, Tom Lane wrote: > Whit Armstrong writes: >> but it is still unclear (at least to me) how to determine as the >> client whether the server has been compiled with the >> HAVE_INT64_TIMESTAMP flag. > > You look at the

Re: [GENERAL] libpq -- reading a timestamp with time zone using binary format

2009-03-23 Thread Tom Lane
Whit Armstrong writes: > but it is still unclear (at least to me) how to determine as the > client whether the server has been compiled with the > HAVE_INT64_TIMESTAMP flag. You look at the integer_datetimes parameter. You could execute a SQL "SHOW" command, but in a libpq client it's sufficient

Re: [GENERAL] unexpected check constraint violation

2009-03-23 Thread Tom Lane
Scott Marlowe writes: > You can either cast the check constraint, or change the field type to > match double precision. The short answer here is that 0.00603::double precision and 0.00603::real are unlikely to be exactly the same value, and which one is greater is a matter of which direction the

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Ivan Sergio Borgonovo
On Mon, 23 Mar 2009 14:11:28 -0700 (PDT) RebeccaJ wrote: > now. Before, I was planning to have CHECK constraints in all of my > text or char fields, to keep out all semicolons, single quotes, and > anything else that looked dangerous. Now I'm thinking that I'll be > using htmlentities(), pg_escap

[GENERAL] Determining/Setting a server's time zone

2009-03-23 Thread Madison Kelly
Hi, How/Where does PostgreSQL set or determine the local time zone? On my server, I am seeing (+00): db=> SELECT now(); now --- 2009-03-23 22:32:47.595491+00 (1 row) But on my workstation I am seeing (-04): db=> SELECT now(); now ---

Re: [GENERAL] PostgreSQL versus MySQL for GPS Data

2009-03-23 Thread Leif B. Kristensen
On Monday 23. March 2009, Juan Pereira wrote: >On March 20, I asked for help in the Newbie MySQL forum, got no > answers. > >Then the forum administrator moved the post to the PostgreSQL MySQL > forum -a forum that deals with PostgreSQL migration issues-, and > again no answers. This kind of suppo

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Scott Marlowe
On Mon, Mar 23, 2009 at 3:11 PM, RebeccaJ wrote: > Scott, your comment above introduced some new concepts to me, and now > I'm thinking about foreign language text and other ways to be more > flexible. I found this page that talks about encoding: > http://www.postgresql.org/docs/8.3/static/multiby

Re: [GENERAL] unexpected check constraint violation

2009-03-23 Thread Scott Marlowe
On Mon, Mar 23, 2009 at 2:52 PM, Jacek Becla wrote: > Thanks Ries. Do you know if that is a postgres feature or a bug? It's not a bug, it's lack of precision in the definition on your part being interpreted by pgsql. When you create the table, you get this: create table t(d real, check(d>=0.006

Re: [GENERAL] unexpected check constraint violation

2009-03-23 Thread Jacek Becla
Thanks Ries. Do you know if that is a postgres feature or a bug? In practice, I wanted to load the data from a file using COPY FROM. Modifying a large csv file in impractical and not very elegant. thanks, Jacek ries van Twisk wrote: On Mar 23, 2009, at 2:54 PM, Jacek Becla wrote: Hi, Can

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread RebeccaJ
On Mar 22, 12:36 pm, scott.marl...@gmail.com (Scott Marlowe) wrote: > ayup. As long as they're legal for your encoding, they'll go right in. > If you wanna stuff in anything no matter the encoding, use a database > initialized for SQL_ASCII encoding. Thanks, everyone, for your contribution to thi

Re: [GENERAL] LISTEN/NOTIFY problem

2009-03-23 Thread Harvey, Allan AC
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org]on Behalf Of Dmitri Girski Sent: Monday, 23 March 2009 10:00 PM To: pgsql-general@postgresql.org Subject: [GENERAL] LISTEN/NOTIFY problem Hi everybody, I've got a weird problem wit

[GENERAL] 1- and 2-dimensional indexes on same column: why is the 2d one preferred?

2009-03-23 Thread Marinos Yannikos
Recent versions of PostgreSQL seem to prefer 2d indexes somehow: for a table "foo" with "i_a" btree (a) "i_ab" btree (a, b) SELECT * FROM foo WHERE a=123 will often use "i_ab" and not "i_a" (even right after ANALYZE). This raises some questions: - is there even any benefit in still having bot

Re: [GENERAL] unexpected check constraint violation

2009-03-23 Thread Scott Marlowe
On Mon, Mar 23, 2009 at 1:54 PM, Jacek Becla wrote: > Hi, > > Can someone explain why postgres complains in this case: > > create table t(d real, check(d>=0.00603)); > insert into t values (0.00603); > > ERROR:  new row for relation "t" violates check constraint "t_d_check" Without any casting, 0

[GENERAL] libpq -- reading a timestamp with time zone using binary format

2009-03-23 Thread Whit Armstrong
how does one determine whether libpq is sending an int64 or a double? I see all of the #ifdefs in the source: #ifdef HAVE_INT64_TIMESTAMP static int64 time2t(const int hour, const int min, const int sec, const fsec_t fsec); #else static double time2t(const int hour, const int min, const int sec,

Re: [GENERAL] unexpected check constraint violation

2009-03-23 Thread ries van Twisk
On Mar 23, 2009, at 2:54 PM, Jacek Becla wrote: Hi, Can someone explain why postgres complains in this case: create table t(d real, check(d>=0.00603)); insert into t values (0.00603); ERROR: new row for relation "t" violates check constraint "t_d_check" thanks Jacek try this: insert in

Re: [GENERAL] unexpected check constraint violation

2009-03-23 Thread Christophe
On Mar 23, 2009, at 1:41 PM, Jeremy Harris wrote: Because equality is not well-defined for "real" values? That was my first thought, too, but why would two identical real literals evaluate to different bit patterns? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To m

Re: [GENERAL] unexpected check constraint violation

2009-03-23 Thread Jeremy Harris
Jacek Becla wrote: create table t(d real, check(d>=0.00603)); insert into t values (0.00603); ERROR: new row for relation "t" violates check constraint "t_d_check" Because equality is not well-defined for "real" values? - Jeremy -- Sent via pgsql-general mailing list (pgsql-general@postgres

[GENERAL] unexpected check constraint violation

2009-03-23 Thread Jacek Becla
Hi, Can someone explain why postgres complains in this case: create table t(d real, check(d>=0.00603)); insert into t values (0.00603); ERROR: new row for relation "t" violates check constraint "t_d_check" thanks Jacek -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] [SQL] bash & postgres

2009-03-23 Thread Tom Lane
Erik Jones writes: > On Mar 23, 2009, at 7:05 AM, Tom Lane wrote: >> The reason you have to do this is that psql doesn't recognize >> backslash commands in a -c string. There's a school of thought that >> doesn't want us to allow multiple commands in a -c string, even. > Hmm... Apparently it doe

Re: [GENERAL] The tuple structure of a not-yet-assigned record is indeterminate.

2009-03-23 Thread M L
2009/3/23 Craig Ringer > M L wrote: > > > CREATE VIEW tabelka AS SELECT someint FROM t_matches; > > What exactly are you trying to do here? If it worked how you've written > it, you'd get the value of `someint' repeated once for each row that > appears in t_matches. > > I don't know exactly wh

Re: [GENERAL] [SQL] bash & postgres

2009-03-23 Thread Erik Jones
On Mar 23, 2009, at 7:05 AM, Tom Lane wrote: Erik Jones writes: On Mar 22, 2009, at 9:03 PM, Greenhorn wrote: How do I use \c (or any other psql commands beginning with a "\") in a bash script? For multi-line input to a psql call in a bash (or any decent shell) script, I'd use a here do

[GENERAL] Proper entry of polygon type data

2009-03-23 Thread Peter Willis
Hello, I would like to use 'polygon' type data and am wondering about the entry format of the vertex coordinates. Are the coordinates of the polygon type to be entered one entry per polygon vertex, or one entry per polygon edge segment? For example: I have a triangle with vertex corners A, B, C

Re: [GENERAL] Garbage Collecting

2009-03-23 Thread justin
Joshua Berry wrote: I'm a postgresql newbie that's inherited eight production servers running Postgresql 8.2.5 as the backend. I have many questions covering topics such as administration of the database (upgrading, maintaining conf files, etc), improving the schema of the system (many tables

Re: [GENERAL] (odbc) multiple step ole db generated error - date/timestamp column

2009-03-23 Thread zach cruise
ok i brought it in as varchar and cast as date. On Sun, Mar 22, 2009 at 12:27 PM, zach cruise wrote: > On Sun, Mar 22, 2009 at 3:39 AM, Craig Ringer > wrote: >> zach cruise wrote: >>> when importing from oracle 10g >> >> Importing how? CSV dump and load? DB link of some sort? > > odbc (see email

[GENERAL] Garbage Collecting

2009-03-23 Thread Joshua Berry
I'm a postgresql newbie that's inherited eight production servers running Postgresql 8.2.5 as the backend. I have many questions covering topics such as administration of the database (upgrading, maintaining conf files, etc), improving the schema of the system (many tables don't currently have prim

Re: [GENERAL] pg_restore error - Any Idea?

2009-03-23 Thread DM
Eric, There was no change in the version, we are using postgres v8.3.5 Thanks Deepak On Sun, Mar 22, 2009 at 11:17 PM, Erik Jones wrote: > > On Mar 22, 2009, at 10:44 PM, DM wrote: > > Hi All, >> >> I am facing an error on executing the below command >> >> dump name: pg_dump_FcZ0.pnps_2009030

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread David Fetter
On Mon, Mar 23, 2009 at 01:07:18AM -0600, Scott Marlowe wrote: > On Mon, Mar 23, 2009 at 12:59 AM, Stephen Cook wrote: > > You should use pg_query_params() rather than build a SQL statement > > in your code, to prevent SQL injection attacks. Also, if you are > > going to read this data back out an

[GENERAL] problem with at proramn

2009-03-23 Thread jrufener
I wrote a program, several hundred lines long so I am not posting it. One of the things I must display is an interval. Workng through it one item at a time, all was well until I added the inteval ecpg type. Now it refuses to execute telling me it cannot find "libpgtypes.so.3". I ran ldd aga

Re: [GENERAL] [SQL] bash & postgres

2009-03-23 Thread Tom Lane
Erik Jones writes: > On Mar 22, 2009, at 9:03 PM, Greenhorn wrote: >> How do I use \c (or any other psql commands beginning with a "\") in a >> bash script? > For multi-line input to a psql call in a bash (or any decent shell) > script, I'd use a here document: Or echo/cat the script into psql

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread Dave Page
On Mon, Mar 23, 2009 at 1:56 PM, josep porres wrote: > well, now a log with only trying to debug setting a breakpoint Hmmm - do you still have the demo schema on that server? Can you try setting a breakpoint on the list_emp() function, and then calling it please? -- Dave Page EnterpriseDB UK:

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread josep porres
in the previous action, first of all I made a breakpoint and called the function from a query window. nothing happened, the only thing i got: the result. All actions are in the previous log. Is it what you want? 2009/3/23 Dave Page > On Mon, Mar 23, 2009 at 1:41 PM, josep porres wrote: > > tha

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread Dave Page
On Mon, Mar 23, 2009 at 1:41 PM, josep porres wrote: > that way I can debug =) OK, so in that case can I get a log of an attempt to set a global breakpoint please? -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

[GENERAL] LISTEN/NOTIFY problem

2009-03-23 Thread Dmitri Girski
Hi everybody, I've got a weird problem with LISTEN/NOTIFY. My C++ app subscribes for the notifications, just like in libpq examples: http://www.postgresql.org/docs/8.3/static/libpq-example.html The only difference, that I am setting the timeout on select just to check if application wants to exit

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread Dave Page
On Mon, Mar 23, 2009 at 1:07 PM, josep porres wrote: > "serverversionstr","serverversionnum","proxyapiver","serverprocessid" > "PostgreSQL 8.3devel on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 > (mingw-special)",80300,3,4220 That should work, despite the mismatch in build envs (ignore

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread josep porres
"serverversionstr","serverversionnum","proxyapiver","serverprocessid" "PostgreSQL 8.3devel on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)",80300,3,4220 2009/3/23 Dave Page > On Mon, Mar 23, 2009 at 12:50 PM, josep porres wrote: > > yes, i have: > > shared_preload_libra

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread Dave Page
On Mon, Mar 23, 2009 at 12:50 PM, josep porres wrote: > yes, i have: > shared_preload_libraries = '$libdir/plugins/plugin_debugger.dll'        # > (change requires restart) Whats the output from: select * from pldbg_get_proxy_info(); -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread josep porres
it is Postgres Plus 8.3 Postgres 8.3.4 build 1400 2009/3/23 josep porres > yes, i have: > shared_preload_libraries = '$libdir/plugins/plugin_debugger.dll'# > (change requires restart) > > > 2009/3/23 Dave Page > > On Mon, Mar 23, 2009 at 12:40 PM, josep porres wrote: >> > mmm... my

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread josep porres
yes, i have: shared_preload_libraries = '$libdir/plugins/plugin_debugger.dll'# (change requires restart) 2009/3/23 Dave Page > On Mon, Mar 23, 2009 at 12:40 PM, josep porres wrote: > > mmm... my database schema have the pldbg functions. > > Do you have something like this in your post

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread Dave Page
On Mon, Mar 23, 2009 at 12:40 PM, josep porres wrote: > mmm...  my database schema have the pldbg functions. Do you have something like this in your postgresql.conf: shared_preload_libraries = '$libdir/plugins/plugin_debugger.so' ? If not, add it, and restart the server (if you're on Windows,

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread josep porres
mmm... my database schema have the pldbg functions. 2009/3/23 Glyn Astill > > > --- On Mon, 23/3/09, josep porres wrote: > > > A lot of time since the last debugging activity. > > I don't remember how to debug. I thought I had to set a > > breaking point in > > the function i want to debug, >

Re: [GENERAL] debugging in pgadmin

2009-03-23 Thread Glyn Astill
--- On Mon, 23/3/09, josep porres wrote: > A lot of time since the last debugging activity. > I don't remember how to debug. I thought I had to set a > breaking point in > the function i want to debug, > and then call that function. > I'm doing this, and from another query window, i call > the

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Sam Mason
On Mon, Mar 23, 2009 at 03:30:09AM -0600, Scott Marlowe wrote: > On Mon, Mar 23, 2009 at 2:33 AM, Ivan Sergio Borgonovo > wrote: > > On Mon, 23 Mar 2009 01:07:18 -0600 Scott Marlowe > > wrote: > >> Are you saying pg_quer_params is MORE effective than > >> pg_escape_string at deflecting SQL inje

[GENERAL] 'create conversion' problem

2009-03-23 Thread Roman
Hello! There is a database in KOI8-R encoding. And we have a client who is querying the database: set client_encoding TO 'ALT' and then he write some data into the database. I have a problem with some symbols which exists in ALT encoding and which are absent in KOI8-R encoding. As result, duri

Re: [GENERAL] Defer a functional index calculation?

2009-03-23 Thread Sam Mason
On Fri, Mar 20, 2009 at 05:37:33PM -0700, Randall Lucas wrote: > I added a functional index. > > create table example (id serial primary key, stuff text, parent_id int); > create index example_root_idx on example (get_root_id(id)); > > (get_root_id(id) pulls an example row and recurses onto p

[GENERAL] debugging in pgadmin

2009-03-23 Thread josep porres
Hi all A lot of time since the last debugging activity. I don't remember how to debug. I thought I had to set a breaking point in the function i want to debug, and then call that function. I'm doing this, and from another query window, i call the function. But it returns me the result, but it does

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Ivan Sergio Borgonovo
On Mon, 23 Mar 2009 03:30:09 -0600 Scott Marlowe wrote: > > I think pg_query_params should make a difference between floats > > and integers and signal an error if you pass float where > > integers are expected... but I'm not sure. > > Not really a security concern, but an early warning for some

Re: [GENERAL] PostgreSQL versus MySQL for GPS Data

2009-03-23 Thread Juan Pereira
On March 20, I asked for help in the Newbie MySQL forum, got no answers. Then the forum administrator moved the post to the PostgreSQL MySQL forum -a forum that deals with PostgreSQL migration issues-, and again no answers. http://forums.mysql.com/read.php?83,253709,253709#msg-253709 Regards J

Re: [GENERAL] Time intersect query

2009-03-23 Thread Alban Hertroys
On Mar 23, 2009, at 5:44 AM, Brad Murray wrote: My current procedure... 1) Create temporary table with each possible data point. This example uses recursive functions from pgsql 8.4 but was originally implemented by using large numbers of queries from php. My knowledge of the recursive f

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Scott Marlowe
On Mon, Mar 23, 2009 at 2:33 AM, Ivan Sergio Borgonovo wrote: > On Mon, 23 Mar 2009 01:07:18 -0600 > Scott Marlowe wrote: > >> On Mon, Mar 23, 2009 at 12:59 AM, Stephen Cook >> wrote: >> > You should use pg_query_params() rather than build a SQL >> > statement in your code, to prevent SQL inject

Re: [GENERAL] The tuple structure of a not-yet-assigned record is indeterminate.

2009-03-23 Thread Craig Ringer
M L wrote: > CREATE VIEW tabelka AS SELECT someint FROM t_matches; What exactly are you trying to do here? If it worked how you've written it, you'd get the value of `someint' repeated once for each row that appears in t_matches. I don't know exactly why you're seeing the behaviour you are. H

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Ivan Sergio Borgonovo
On Mon, 23 Mar 2009 01:07:18 -0600 Scott Marlowe wrote: > On Mon, Mar 23, 2009 at 12:59 AM, Stephen Cook > wrote: > > You should use pg_query_params() rather than build a SQL > > statement in your code, to prevent SQL injection attacks. Also, > > if you are going to read this data back out and s

Re: [GENERAL] bash & postgres

2009-03-23 Thread Ivan Sergio Borgonovo
On Mon, 23 Mar 2009 15:03:15 +1100 Greenhorn wrote: > Hi, > > I'm trying to pass variables on a bash script embedded with psql > commands. > > cat header.txt > > "to1","from1","subject1" > "to2","from2","subject2" > "to3","from3","subject3" > "to4","from4","subject4" > > cat b.sh > > #!/bin/

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread David Wilson
On Mon, Mar 23, 2009 at 3:07 AM, Scott Marlowe wrote: > Are you saying pg_quer_params is MORE effective than pg_escape_string > at deflecting SQL injection attacks? pg_query_params() will protect non-strings. For instance, read a number in from user input and do something of the form " and foo=$

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Scott Marlowe
On Mon, Mar 23, 2009 at 12:59 AM, Stephen Cook wrote: > You should use pg_query_params() rather than build a SQL statement in your > code, to prevent SQL injection attacks. Also, if you are going to read this > data back out and show it on a web page you probably should make sure there > is no rog

Re: [GENERAL] text column constraint, newbie question

2009-03-23 Thread Stephen Cook
You should use pg_query_params() rather than build a SQL statement in your code, to prevent SQL injection attacks. Also, if you are going to read this data back out and show it on a web page you probably should make sure there is no rogue HTML or JavaScript or anything in there with htmlentitie