Re: [GENERAL] libpq and Datums management with embedded C function

2011-02-18 Thread Alessandro Candini
I see that dblink is 2500 lines more or less... Is there anyone how to set up correctly the 2 lines I posted before? I will explore SPI anyway hoping it will gett my life easier... On Thu, Feb 17, 2011 at 4:16 AM, Alessandro Candinicand...@meeo.it wrote: I'm dealing witch a C function

Re: [GENERAL] Any feedback on this query?

2011-02-18 Thread Dean Rasheed
On 18 February 2011 07:19, Mike Christensen m...@kitchenpc.com wrote: Here's my query: SELECT R.RecipeId, R.Title, R.Description, R.ImageUrl, R.Rating, R.PrepTime, R.CookTime, R.OwnerId, U.Alias FROM Recipes R INNER JOIN Users U ON U.UserId = R.OwnerId WHERE (R.PrepTime = :maxprep) ORDER

Re: [GENERAL] The efficiency of the WAL log writer

2011-02-18 Thread Steven Elliott
On Thu, 2011-02-17 at 10:26 -0500, Tom Lane wrote: Steven Elliott sellio...@austin.rr.com writes: I don't think the current behavior is particularly harmful, but maybe PostgreSQL could be made to idle more quietly. Yeah, this is something that's on my personal to-do list. It's not really

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Geoffrey Myers
Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 psql:test.sql:11: ERROR: current transaction is aborted, commands ignored until end of transaction block Oops my bad, I forgot to tell you I have \set ON_ERROR_ROLLBACK on in my .psqlrc. So you'll need to add

Re: [GENERAL] libpq and Datums management with embedded C function

2011-02-18 Thread Merlin Moncure
On Fri, Feb 18, 2011 at 2:04 AM, Alessandro Candini cand...@meeo.it wrote: On Thu, Feb 17, 2011 at 4:16 AM, Alessandro Candinicand...@meeo.it  wrote: I'm dealing witch a C function embedded into postgresql-9.0.2. I'm returning a set of rows and following the example here

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 So I added the on_error_rollback to the script and I get this: ... psql:test.sql:12: ERROR: current transaction is aborted, commands ignored until end of transaction block That isn't right: are you sure you said ON_ERROR_ROLLBACK? It's

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Geoffrey Myers
Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 So I added the on_error_rollback to the script and I get this: ... psql:test.sql:12: ERROR: current transaction is aborted, commands ignored until end of transaction block That isn't right: are you sure you

Re: [GENERAL] database instance creation

2011-02-18 Thread Chris Browne
prabakara...@zohocorp.com (prabakaran.a) writes: Dear All,  In Mysql, If we create a directory under mysql/data, mysql treated as database instance without starting mysql server.  Is there any similar provision in postgres where we can create a database instance without starting postgresql

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 cut and paste: set ON_ERROR_ROLLBACK; Should be \set ON_ERROR_ROLLBACK on You can also set this when calling psql like so: psql --set ON_ERROR_ROLLBACK=on But that's getting off-topic now, as we've got the problem narrowed: INSERT 0 1

Re: [GENERAL] Any feedback on this query?

2011-02-18 Thread Mike Christensen
On Fri, Feb 18, 2011 at 1:05 AM, Dean Rasheed dean.a.rash...@gmail.com wrote: On 18 February 2011 07:19, Mike Christensen m...@kitchenpc.com wrote: Here's my query: SELECT R.RecipeId, R.Title, R.Description, R.ImageUrl, R.Rating, R.PrepTime, R.CookTime, R.OwnerId, U.Alias FROM Recipes R

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Geoffrey Myers
Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 cut and paste: set ON_ERROR_ROLLBACK; Should be \set ON_ERROR_ROLLBACK on You can also set this when calling psql like so: psql --set ON_ERROR_ROLLBACK=on But that's getting off-topic now, as we've got the

[GENERAL] Logged statement apparently did not commited...

2011-02-18 Thread Ioana Danes
Hello Everyone, I would like to kindly ask for your help regarding a strange situation I meet yesterday. It might not be a postgres issue but I run out of ideas on what to test or check and so far I could not reproduce the behavior. I have 2 (master - slave) postgres 9.0.3 databases running on

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I'm not sure how to address this. I'm not exactly sure where to place session_replication_role. It's very close to the top of the file: Is this a pg_dumpall? A \connect later on will reset the session_replication_role. If so, add the SET

[GENERAL] Canceling a DELETE query

2011-02-18 Thread Norberto Delle
Hi What are the effects of canceling a DELETE command before it completes execution? Something will be deleted at all? Norberto -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Chris Browne
li...@serioustechnology.com (Geoffrey Myers) writes: Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 cut and paste: set ON_ERROR_ROLLBACK; Should be \set ON_ERROR_ROLLBACK on You can also set this when calling psql like so: psql --set

[GENERAL] constraining chars for all cols of a table

2011-02-18 Thread Gauthier, Dave
Hi: I have to constrain the chars used for table columns. For example... create table foo (col1 text, col2 text, col3 text); ... where col1 has to be all uppercase, nothing but [A-Z] col2 has to be all lowercase [a-z] plus [0-9] is also allowed col3 can be mixed case plus [0-9]

Re: [GENERAL] Canceling a DELETE query

2011-02-18 Thread Vick Khera
On Fri, Feb 18, 2011 at 2:27 PM, Norberto Delle betode...@gmail.com wrote: What are the effects of canceling a DELETE command before it completes execution? Something will be deleted at all? no. it runs as a transaction, so either all or nothing. -- Sent via pgsql-general mailing list

Re: [GENERAL] constraining chars for all cols of a table

2011-02-18 Thread David Johnston
Restrict access to the table (for inserts) to a function that does the verification and then executes the insert in addition to any kind of logging and RAISEing you need. If you need to validate existing data I'd probably just do some one-time verifications and updates where required. A

Re: [GENERAL] constraining chars for all cols of a table

2011-02-18 Thread Gauthier, Dave
Restrict access to the table (for inserts) to a function that does the verification and then executes the insert in addition to any kind of logging and RAISEing you need. Wouldn't that be akin to doing the checking in the insert and update before triggers? That's certainly possible, but I

Re: [GENERAL] constraining chars for all cols of a table

2011-02-18 Thread David Johnston
I don't fully follow the issue or usage pattern. It may not be perfect database design but you should be most concerned with user generated data. If you are cascading within the database (or application) system and you have this kind of extreme 1-input/1000-output relationship then you should

Re: [GENERAL] constraining chars for all cols of a table

2011-02-18 Thread Gauthier, Dave
Yes, I was doing that in the app that inserts/updates the records. But someone coming at this via direct sql would bypass the check in the app. :-( From: David Johnston [mailto:pol...@yahoo.com] Sent: Friday, February 18, 2011 5:10 PM To: Gauthier, Dave; pgsql-general@postgresql.org Subject:

[GENERAL] Explicit NULL for no INTEGER data?

2011-02-18 Thread Rich Shepard
I have a data file I want to copy into a table. The column name and attribute is: depth_seal INTEGER one of the rows in the .csv file I want to bring into the table has no value for this column, but there is no explicit NULL in the text file. When I try to copy the file psql

Re: [GENERAL] constraining chars for all cols of a table

2011-02-18 Thread David Johnston
Hence my original comment. If you move the logic that was in the application into the database via a function, and restrict direct inserts and updates other via that (or supporting) functions, you force direct SQL users to use those functions - and thus your validation logic - to get the data

Re: [GENERAL] Explicit NULL for no INTEGER data? -- Update

2011-02-18 Thread Rich Shepard
On Fri, 18 Feb 2011, Rich Shepard wrote: Do I need an explicit NULL in that column? Update: Placing NULL or a blank produces the same error. How should I represent no value for an integer column in a .csv file? Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] Explicit NULL for no INTEGER data? -- Update

2011-02-18 Thread Mike Christensen
Judging from: http://www.postgresql.org/docs/8.1/static/sql-copy.html It looks like you have to specify your own NULL string with the NULL AS parameter of the COPY command. On Fri, Feb 18, 2011 at 3:12 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Fri, 18 Feb 2011, Rich Shepard wrote:

[GENERAL] Postgresql prepared transactions

2011-02-18 Thread Radosław Smogura
Hi, I do following commands test=# BEGIN; BEGIN test=# insert into testxa1 values(1); INSERT 0 1 test=# insert dup; ERROR: syntax error at or near dup LINE 1: insert dup; ^ test=# PREPARE TRANSACTION 'a'; ROLLBACK Why on prepare transaction I

Re: [GENERAL] Postgresql prepared transactions

2011-02-18 Thread Tom Lane
=?utf-8?q?Rados=C5=82aw_Smogura?= rsmog...@softperience.eu writes: I do following commands test=# BEGIN; BEGIN test=# insert into testxa1 values(1); INSERT 0 1 test=# insert dup; ERROR: syntax error at or near dup LINE 1: insert dup; ^

Re: [GENERAL] Explicit NULL for no INTEGER data? -- Update

2011-02-18 Thread Rich Shepard
On Fri, 18 Feb 2011, Mike Christensen wrote: It looks like you have to specify your own NULL string with the NULL AS parameter of the COPY command. Mike, I completely missed that option when I've read the copy page. My apologies! Rich -- Sent via pgsql-general mailing list

Re: [GENERAL] Explicit NULL for no INTEGER data? -- Update

2011-02-18 Thread Mike Christensen
It looks like you have to specify your own NULL string with the NULL AS parameter of the COPY command. Mike,  I completely missed that option when I've read the copy page. My apologies! Rich Awesome, I'm the one usually asking easy questions on this mailing list so I'm just glad I could

Re: [GENERAL] Postgresql prepared transactions

2011-02-18 Thread Radosław Smogura
Tom Lane t...@sss.pgh.pa.us Saturday 19 February 2011 00:48:00 =?utf-8?q?Rados=C5=82aw_Smogura?= rsmog...@softperience.eu writes: I do following commands test=# BEGIN; BEGIN test=# insert into testxa1 values(1); INSERT 0 1 test=# insert dup; ERROR: syntax error at or

[GENERAL] mysql 2 pg script...

2011-02-18 Thread andrew1
hi all, I need to load mysql dump to postgre 8.3 . Is there a script to do that? I hoped to use my2pg.pl , but couldn't find it. It looks like it's not a part of /contrib in debian lenny. what shoud I use for 8.3? thanks. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] constraining chars for all cols of a table

2011-02-18 Thread Susan Cassidy
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Gauthier, Dave Sent: Friday, February 18, 2011 1:24 PM To: pgsql-general@postgresql.org Subject: [GENERAL] constraining chars for all cols of a table Hi: I have to constrain the chars used

[GENERAL] Service missing after windows 2008 upgrade

2011-02-18 Thread Noceda, Noel
Hi, I recently upgraded my system from windows 2003 to windows 2008 (not a clean install). However, my postgres won't work. I've checked the services console and postgres service is missing. Is there a way I can fix this? Thanks, [cid:image001.jpg@01CBCF51.2E6B5DC0] Noel Noceda Production

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Geoffrey Myers
Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 cut and paste: set ON_ERROR_ROLLBACK; Should be \set ON_ERROR_ROLLBACK on You can also set this when calling psql like so: psql --set ON_ERROR_ROLLBACK=on But that's getting off-topic now, as we've got the

[GENERAL] Schema Archive cant find table

2011-02-18 Thread trex005
I am trying to archive a schema, however there is a certain table that gets skipped with pd_dump The table's name is 'servers'. I checked to see if it is a reserved word, and it does not appear to be... Thinking I was missing something I tried using -t servers, and I get : pg_dump: No matching

Re: [GENERAL] database instance creation

2011-02-18 Thread prabakaran.a
Thanks.Thanks,Prabakaran A On Fri, 18 Feb 2011 12:54:09 +0530 Magnus Hagander mag...@hagander.net wrote On Thu, Feb 17, 2011 at 11:35, prabakaran.a prabakara...@zohocorp.com wrote: Dear All,In Mysql, If we create a directory under mysql/data, mysql treated as database instance without