Re: [GENERAL] PostgreSQL function can not load dll library.

2009-10-26 Thread Craig Ringer
On Tue, 2009-10-27 at 02:19 -0400, a.bhattacha...@sungard.com wrote: > I am creating a dll using MSVC 2005 and trying to call the dll from my > Postgres function OK, so you're creating a PostgreSQL module implementing one or more SQL-callable functions in C. When you load it into the server with

[GENERAL] PostgreSQL function can not load dll library.

2009-10-26 Thread A.Bhattacharya
Hi All, I am creating a dll using MSVC 2005 and trying to call the dll from my Postgres function but unfortunately PostgreSQL is throwing an error message saying: ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/watchlist.dll": The specified module could not be found. SQL

Re: [GENERAL] Is there any ways to pass an array as parameter in libpq?

2009-10-26 Thread Craig Ringer
On Tue, 2009-10-27 at 08:07 +0800, ChenXun wrote: > Hello, > > I'm starting to learn programming with libpq. > In the main loop of my code, I will receive some data in the format of > an array of a struct. The data will be inserted to the database, in > different lines. I also need to update the

Re: [GENERAL] Implementing Frontend/Backend Protocol TCP/IP

2009-10-26 Thread Craig Ringer
On Mon, 2009-10-26 at 20:15 -0300, Alvaro Herrera wrote: > Raimon Fernandez wrote: > > > > > > Hello, > > > > > > I'm trying to implement the front-end protocol with TCP from > > REALbasic to PostgreSQL. > > That sounds the most difficult way to do it. Can't you just embed > libpq? +1 Alm

[GENERAL] How does PostgreSQL recognise "deleted" tuples by using xmax ?

2009-10-26 Thread 纪晓曦
How does PostgreSQL recognise "deleted" tuples by using xmax ?

Re: [GENERAL] cursor MOVE vs OFFSET in SELECT

2009-10-26 Thread silly8888
On Mon, Oct 26, 2009 at 10:28 AM, Alvaro Herrera wrote: > silly escribió: >> 2009/10/26 Grzegorz Jaśkiewicz : >> > >> > >> > On Mon, Oct 26, 2009 at 10:30 AM, silly wrote: >> >> >> >> Suppose that you have a query, say $sql_query, which is very >> >> complicated and produces many rows. Wh

Re: [GENERAL] drop view and recreate - for sync

2009-10-26 Thread Craig Ringer
Vick Khera wrote: > On Fri, Oct 23, 2009 at 6:44 PM, Sydney Puente wrote: >> Ah I see what you mean - thanks very much that is v helpful! >> Yes the copy will be read-only. >> Will have 3 tables of data, being read (readonly) and in the background >> Will have 3 shadow tables populated from an unr

[GENERAL] Is there any ways to pass an array as parameter in libpq?

2009-10-26 Thread ChenXun
Hello, I'm starting to learn programming with libpq. In the main loop of my code, I will receive some data in the format of an array of a struct. The data will be inserted to the database, in different lines. I also need to update the last record in the table before the insertion. So I pla

Re: [GENERAL] Implementing Frontend/Backend Protocol TCP/IP

2009-10-26 Thread John R Pierce
Alvaro Herrera wrote: I'm trying to implement the front-end protocol with TCP from REALbasic to PostgreSQL. That sounds the most difficult way to do it. Can't you just embed libpq? yah, seriously. the binary protocol is not considered stable, it can change in subtle ways in each v

Re: [GENERAL] Implementing Frontend/Backend Protocol TCP/IP

2009-10-26 Thread Alvaro Herrera
Raimon Fernandez wrote: > > > Hello, > > > I'm trying to implement the front-end protocol with TCP from > REALbasic to PostgreSQL. That sounds the most difficult way to do it. Can't you just embed libpq? -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreS

Re: [GENERAL] How to list user-specific configuration parameters?

2009-10-26 Thread Tim Landscheidt
Alvaro Herrera wrote: >> how can I list the user-specific configuration parameters, >> i. e. those set by "ALTER ROLE name SET ..."? > Get them from the pg_authid catalog. > 8.5 alpha2 has a new \drds command in psql for that purpose. Thanks! Tim -- Sent via pgsql-general mailing list (pgs

Re: [GENERAL] CSV files & empty strings

2009-10-26 Thread Niklas Johansson
On 20 okt 2009, at 16.15, Raymond O'Donnell wrote: On 20/10/2009 05:55, Nate Randall wrote: However, I need some method of "converting" the empty string "" values into NULL values after import, so that I can change the date fields back to date-type. Any suggestions on how this could be acc

Re: [GENERAL] [ANNOUNCE] [pgeu-general] PGDay.EU 2009 - approaching fast!

2009-10-26 Thread Joshua D. Drake
On Mon, 2009-10-26 at 21:36 +, Peter Geoghegan wrote: > > Sure ? You *have to* ask for the ParisTech rooms (there were still 10 rooms > > available on friday, only for Paristech) Else the hotel is full. > > I called on Saturday afternoon. I was sure to specify that I was a > Paristech member,

[GENERAL] Implementing Frontend/Backend Protocol TCP/IP

2009-10-26 Thread Raimon Fernandez
Hello, I'm trying to implement the front-end protocol with TCP from REALbasic to PostgreSQL. The docs from PostgreSQL, well, I understand almost, but there are some points that maybe need more clarification. Anyone have some experience to start making questions ? :-) The front-end t

Re: [GENERAL] [ANNOUNCE] [pgeu-general] PGDay.EU 2009 - approaching fast!

2009-10-26 Thread Peter Geoghegan
> Sure ? You *have to* ask for the ParisTech rooms (there were still 10 rooms > available on friday, only for Paristech) Else the hotel is full. I called on Saturday afternoon. I was sure to specify that I was a Paristech member, but they were still apparently fully booked. Regards, Peter Geogheg

Re: [GENERAL] How do I pipe output from query to a file in PostgreSQL?

2009-10-26 Thread Raymond O'Donnell
On 26/10/2009 18:03, Penrod, John wrote: > In oracle: > > SPOOL filename.txt > Select * from customer; > SPOOL OFF > > Results are piped to filename.txt > > > How do I do this from the psql command line? \g will execute the query and send the result to . Ray. -- Raymond O'Donnell :: Galw

Re: [GENERAL] How do I pipe output from query to a file in PostgreSQL?

2009-10-26 Thread Kevin Kempter
On Monday 26 October 2009 12:03:13 Penrod, John wrote: > In oracle: > > SPOOL filename.txt > Select * from customer; > SPOOL OFF > > Results are piped to filename.txt > > > How do I do this from the psql command line? > > > John J. Penrod, OCP > Oracle/EnterpriseDB Database Administrator > St

[GENERAL] How do I pipe output from query to a file in PostgreSQL?

2009-10-26 Thread Penrod, John
In oracle: SPOOL filename.txt Select * from customer; SPOOL OFF Results are piped to filename.txt How do I do this from the psql command line? John J. Penrod, OCP Oracle/EnterpriseDB Database Administrator St. Jude Children's Research Hospital

Re: [GENERAL] Postmaster taking 100% of the CPU

2009-10-26 Thread David Kerr
On Mon, Oct 26, 2009 at 04:38:51PM -0400, Tom Lane wrote: - David Kerr writes: - > Looks like it was a query that was running. once my developer killed it the CPU went back down. - > I'm a little surprised by that, the backend process for that developer wasn't taking up a lot of CPU, - > just th

Re: [GENERAL] Postmaster taking 100% of the CPU

2009-10-26 Thread Tom Lane
David Kerr writes: > Looks like it was a query that was running. once my developer killed it the > CPU went back down. > I'm a little surprised by that, the backend process for that developer wasn't > taking up a lot of CPU, > just the postmaster itself. The backtrace you showed was most defini

Re: [GENERAL] [ANNOUNCE] [pgeu-general] PGDay.EU 2009 - approaching fast!

2009-10-26 Thread Dave Page
On Mon, Oct 26, 2009 at 2:12 PM, Raymond O'Donnell wrote: > On 20/10/2009 12:52, Thom Brown wrote: > >> And there's special hotel rates at the Kyriad Hotel, in Porte d'Ivry >> for those attending the conference.  See http://2009.pgday.eu/hotels >> for details. > > I gather from another Irish atten

Re: [GENERAL] Why does pg_dump set default_with_oids to true?

2009-10-26 Thread Tom Lane
Alvaro Herrera writes: > Kynn Jones escribió: >> The documentation deprecates setting this variable to true. Why does >> pg_dump do it? > To dump tables that were created WITH OIDS. What is deprecated is the use of the WITH OIDS feature, not the variable ;-). But it is not pg_dump's charter to

Re: [GENERAL] Logging statements with errors in PostgreSQL 8.1

2009-10-26 Thread John R Pierce
Radcon Entec wrote: Is there any way to get a PostgreSQL 8.1 installation to report the statements that caused the error, as the 8.3 installation does? see http://www.postgresql.org/docs/8.1/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT specifically, log_statement, and log

Re: [GENERAL] Logging statements with errors in PostgreSQL 8.1

2009-10-26 Thread Adrian Klaver
On Monday 26 October 2009 5:48:42 am Radcon Entec wrote: > Greetings! > > I am using PostgreSQL 8.3, as are most of our customers. But we still have > at least one who is using PostgreSQL 8.1. The log files from that customer > are showing repeated syntax errors, but they are not giving me any >

Re: [GENERAL] Postmaster taking 100% of the CPU

2009-10-26 Thread David Kerr
Looks like it was a query that was running. once my developer killed it the CPU went back down. I'm a little surprised by that, the backend process for that developer wasn't taking up a lot of CPU, just the postmaster itself. Any idea why that would be? Thanks Dave On Mon, Oct 26, 2009 at 1

Re: [GENERAL] How to list user-specific configuration parameters?

2009-10-26 Thread Vick Khera
On Mon, Oct 26, 2009 at 1:58 PM, Tim Landscheidt wrote: > Hi, > > how can I list the user-specific configuration parameters, > i. e. those set by "ALTER ROLE name SET ..."? I've been using "pg_dumpall --globals-only" to view them, but it is clearly sub-optimal to do it that way. I'm sure if you

Re: [GENERAL] joining an array with a table or...?

2009-10-26 Thread Ivan Sergio Borgonovo
On Mon, 26 Oct 2009 14:56:26 -0400 Merlin Moncure wrote: > On Mon, Oct 26, 2009 at 11:05 AM, Ivan Sergio Borgonovo > wrote: > > To make it more concrete I came up with: > > > > select coalesce(u.mail,j.mail) from ( > >  select (array['m...@example1.com','m...@example2.com'])[i] as mail > >   fro

Re: [GENERAL] Postmaster taking 100% of the CPU

2009-10-26 Thread Vick Khera
On Mon, Oct 26, 2009 at 1:30 PM, David Kerr wrote: > Postmaster's been spinning at 99/100% for a few hours. > What does "select * from pg_stat_activity" show you? Look for your long(est) running query. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

Re: [GENERAL] [ANNOUNCE] [pgeu-general] PGDay.EU 2009 - approaching fast!

2009-10-26 Thread Peter Geoghegan
> I gather from another Irish attendee that this one is booked out now. Yes, it was booked out, but they said I should ring back the next day, which suggested that they may have expected some cancellations or something. In any case, I booked the Kyriad Cachan. The PgDay EU site says that the Kyri

Re: [GENERAL] [ANNOUNCE] [pgeu-general] PGDay.EU 2009 - approaching fast!

2009-10-26 Thread Raymond O'Donnell
On 26/10/2009 19:08, Cédric Villemain wrote: > Le lundi 26 octobre 2009 15:12:10, Raymond O'Donnell a écrit : >> On 20/10/2009 12:52, Thom Brown wrote: >>> And there's special hotel rates at the Kyriad Hotel, in Porte d'Ivry >>> for those attending the conference. See http://2009.pgday.eu/hotels >

Re: [GENERAL] How to list user-specific configuration parameters?

2009-10-26 Thread Alvaro Herrera
Tim Landscheidt wrote: > Hi, > > how can I list the user-specific configuration parameters, > i. e. those set by "ALTER ROLE name SET ..."? Get them from the pg_authid catalog. 8.5 alpha2 has a new \drds command in psql for that purpose. -- Alvaro Herrerahttp://

Re: [GENERAL] [ANNOUNCE] [pgeu-general] PGDay.EU 2009 - approaching fast!

2009-10-26 Thread Cédric Villemain
Le lundi 26 octobre 2009 15:12:10, Raymond O'Donnell a écrit : > On 20/10/2009 12:52, Thom Brown wrote: > > And there's special hotel rates at the Kyriad Hotel, in Porte d'Ivry > > for those attending the conference. See http://2009.pgday.eu/hotels > > for details. > > I gather from another Irish

Re: [GENERAL] Why does pg_dump set default_with_oids to true?

2009-10-26 Thread Alvaro Herrera
Kynn Jones escribió: > I've noticed that the dumps generated by pg_dump set the parameter > default_with_oids to true in various places (separated by setting it back to > false in-between). > > This happens even for databases whose creation and maintenance did not > involve any explicit setting of

[GENERAL] Logging statements with errors in PostgreSQL 8.1

2009-10-26 Thread Radcon Entec
Greetings! I am using PostgreSQL 8.3, as are most of our customers. But we still have at least one who is using PostgreSQL 8.1. The log files from that customer are showing repeated syntax errors, but they are not giving me any information about where the errors are coming from. Here's a sam

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-26 Thread Timothy Madden
On Mon, Oct 26, 2009 at 6:37 AM, Pavel Stehule wrote: > 2009/10/26 Tom Lane : > > Alvaro Herrera writes: > >> SQL/PSM is a different beast than all the rest of the PLs, because it is > >> standard, so I am sure that we will want to implement the standard > >> syntax (no string literal) when we ha

Re: [GENERAL] joining an array with a table or...?

2009-10-26 Thread Merlin Moncure
On Mon, Oct 26, 2009 at 11:05 AM, Ivan Sergio Borgonovo wrote: > To make it more concrete I came up with: > > select coalesce(u.mail,j.mail) from ( >  select (array['m...@example1.com','m...@example2.com'])[i] as mail >   from generate_series(1,2) i) j >   left join users u on upper(u.mail)=upper(

Re: [GENERAL] Why does pg_dump set default_with_oids to true?

2009-10-26 Thread Joshua D. Drake
On Mon, 2009-10-26 at 11:04 -0400, Kynn Jones wrote: > I've noticed that the dumps generated by pg_dump set the parameter > default_with_oids to true in various places (separated by setting it > back to false in-between). > > > This happens even for databases whose creation and maintenance did no

[GENERAL] How to list user-specific configuration parameters?

2009-10-26 Thread Tim Landscheidt
Hi, how can I list the user-specific configuration parameters, i. e. those set by "ALTER ROLE name SET ..."? Tim -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Postmaster taking 100% of the CPU

2009-10-26 Thread David Kerr
Postmaster's been spinning at 99/100% for a few hours. trying to get an idea what would have caused it. I'm on PG 8.3.5 linux. Here's the gdb output (I'm not really all that gdb savvy, so if something else would let me know) 0x08281959 in textin () (gdb) bt #0 0x08281959 in textin () #1 0x08

[GENERAL] Operational performance: one big table versus many smaller tables

2009-10-26 Thread David Wall
If I have various record types that are "one up" records that are structurally similar (same columns) and are mostly retrieved one at a time by its primary key, is there any performance or operational benefit to having millions of such records split across multiple tables (say by their applicat

[GENERAL] Defining roles

2009-10-26 Thread Michael Gould
In our system we have a hybrid security system. We have tables that I want to make sure that based on membership in a group that update and/or delete is not allowed to a specific group. We also have application level security which is much more granular and is much more job function based. Our app

Re: [GENERAL] joining an array with a table or...?

2009-10-26 Thread Ivan Sergio Borgonovo
On Mon, 26 Oct 2009 14:15:26 +0100 Ivan Sergio Borgonovo wrote: > I've a list of emails and a list of users (with emails). > > If the list of emails was already inside a table > > create table mails ( > mail varchar(64) > ); > > create table users ( > name varchar(127), > mail varchar(64)

[GENERAL] Why does pg_dump set default_with_oids to true?

2009-10-26 Thread Kynn Jones
I've noticed that the dumps generated by pg_dump set the parameter default_with_oids to true in various places (separated by setting it back to false in-between). This happens even for databases whose creation and maintenance did not involve any explicit setting of this parameter. The documentati

Re: [GENERAL] cursor MOVE vs OFFSET in SELECT

2009-10-26 Thread Alvaro Herrera
silly escribió: > 2009/10/26 Grzegorz Jaśkiewicz : > > > > > > On Mon, Oct 26, 2009 at 10:30 AM, silly wrote: > >> > >> Suppose that you have a query, say $sql_query, which is very > >> complicated and produces many rows. Which of the following is going to > >> be faser: > >> > >>    $sql_

Re: [GENERAL] drop view and recreate - for sync

2009-10-26 Thread Vick Khera
On Fri, Oct 23, 2009 at 6:44 PM, Sydney Puente wrote: > Ah I see what you mean - thanks very much that is v helpful! > Yes the copy will be read-only. > Will have 3 tables of data, being read (readonly) and in the background > Will have 3 shadow tables populated from an unreliable db over an unrel

Re: [GENERAL] [ANNOUNCE] [pgeu-general] PGDay.EU 2009 - approaching fast!

2009-10-26 Thread Raymond O'Donnell
On 20/10/2009 12:52, Thom Brown wrote: > And there's special hotel rates at the Kyriad Hotel, in Porte d'Ivry > for those attending the conference. See http://2009.pgday.eu/hotels > for details. I gather from another Irish attendee that this one is booked out now. Ray. -- Raymond O'Donnell ::

[GENERAL] joining an array with a table or...?

2009-10-26 Thread Ivan Sergio Borgonovo
I've a list of emails and a list of users (with emails). If the list of emails was already inside a table create table mails ( mail varchar(64) ); create table users ( name varchar(127), mail varchar(64) ); I'd do: select coalesce(u.mail, m.mail) from mails left join users on u.mail=m.mail

Re: [GENERAL] cursor MOVE vs OFFSET in SELECT

2009-10-26 Thread Pavel Stehule
2009/10/26 Grzegorz Jaśkiewicz : > > > On Mon, Oct 26, 2009 at 10:30 AM, silly wrote: >> >> Suppose that you have a query, say $sql_query, which is very >> complicated and produces many rows. Which of the following is going to >> be faser: >> >>    $sql_query OFFSET 3000 LIMIT 12; >> >> or >>

Re: [GENERAL] cursor MOVE vs OFFSET in SELECT

2009-10-26 Thread silly8888
2009/10/26 Grzegorz Jaśkiewicz : > > > On Mon, Oct 26, 2009 at 10:30 AM, silly wrote: >> >> Suppose that you have a query, say $sql_query, which is very >> complicated and produces many rows. Which of the following is going to >> be faser: >> >>    $sql_query OFFSET 3000 LIMIT 12; >> >> or >>

[GENERAL] Allowed types in embedded SQL, ecpg

2009-10-26 Thread Hans-Michael Stahl
When reading the documentation (Section 32.6.3. Different types of host variables) I find description only for basic date types. It is not described, how I can retrieve, for example, a big integer, byte varying, bit varying, or text data type in embedded SQL. Is this not possible, or is it only no

Re: [GENERAL] cursor MOVE vs OFFSET in SELECT

2009-10-26 Thread Grzegorz Jaśkiewicz
On Mon, Oct 26, 2009 at 10:30 AM, silly wrote: > Suppose that you have a query, say $sql_query, which is very > complicated and produces many rows. Which of the following is going to > be faser: > >$sql_query OFFSET 3000 LIMIT 12; > > or > >BEGIN; >DECLARE cur1 CURSOR FOR $sql_que

[GENERAL] cursor MOVE vs OFFSET in SELECT

2009-10-26 Thread silly8888
Suppose that you have a query, say $sql_query, which is very complicated and produces many rows. Which of the following is going to be faser: $sql_query OFFSET 3000 LIMIT 12; or BEGIN; DECLARE cur1 CURSOR FOR $sql_query; MOVE 3000 IN cur1; FETCH 12 FROM cur1; COMMIT; Nat