Re: [GENERAL] Help trying to write my first plpgsql function...

2005-09-21 Thread Bjørn T Johansen
I am not sure why I used subselect, I just saw an example and followed it.. But now it's working as it should... Thx for all the help! :) BTJ On 9/19/05, Bjørn T Johansen btj ( at ) havleik ( dot ) no wrote: CREATE OR REPLACE FUNCTION trykkStatus (pressID INTEGER) RETURNS SetOf

[GENERAL] array_dims array_lower/upper distance

2005-09-21 Thread Matthew Peter
Wondering if there's a way for postgres to return how many elements are in a array as a single integer? For instance, returning 10 (items in array) instead of [-5:4] Also, is there a way to return the position of an item in a array? __ Yahoo!

Re: [GENERAL] More efficient INs when comparing two columns

2005-09-21 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-09-20 20:45:21 +0200: I was thinking if this was possible in some way.. I have this table where we have X and Y coordinates, and i need to select several in one go. # select * from xy where (x = 1 and y = 2) or (x = 2 and y = 2); This works but are not so nice

[GENERAL] pg_index_indrelid_index error, any ideas ??

2005-09-21 Thread aw_contact
I've got an error from postgresql server - ERROR: root page 1 of pg_index_indrelid_index has level 512, expected 0 This error appears on every command and i can't do anything with my database. Is it possible to solve this problem ? ---(end of

Re: [GENERAL] deactivating/activating constraint

2005-09-21 Thread Oleg
Thank you very much. With DEFERRABLE INITIALLY DEFERRED (at the end of the constraint) it works fine now Sebastian Böck schrieb: Oleg wrote: Dear All, is it possible to temporary deactivate a constraint in PostgreSQL? There is a constraint that does not allow me to write some data (see

[GENERAL] Win32 Backup and Restore of large databases.

2005-09-21 Thread Howard Cole
On a Win32 machine, can I backup a database if the backup file exceeds 2GB? In linux, I can split the backup file into multiple files. Can this be done on Win32? Regards Howard Cole www.selestial.com ---(end of broadcast)--- TIP 5: don't forget

Re: [GENERAL] Win32 Backup and Restore of large databases.

2005-09-21 Thread Tony Caduto
Howard Cole wrote: On a Win32 machine, can I backup a database if the backup file exceeds 2GB? In linux, I can split the backup file into multiple files. Can this be done on Win32? Regards Howard Cole www.selestial.com ---(end of

[GENERAL] Problem with libpq3 postgresql8

2005-09-21 Thread Alex R. Mosteo
Hello, I have a client program which worked ok, using libpq3 agains a 7.4 database. Both linux versions. The client and server are in separate machines connecting via TCP/IP. I've just updated the database to 8.0, and the client program now can't connect. There's no error message, it simply gets

Re: [GENERAL] Problem with libpq3 postgresql8

2005-09-21 Thread Devrim GUNDUZ
Hi, On Wed, 21 Sep 2005, Alex R. Mosteo wrote: I have a client program which worked ok, using libpq3 agains a 7.4 database. Both linux versions. The client and server are in separate machines connecting via TCP/IP. I've just updated the database to 8.0, and the client program now can't

[GENERAL] pgclient hostbased authentication

2005-09-21 Thread Bohdan Linda
Hello, may I ask, how(or which) ip is checked against pg_hba.conf IP entry in NAT environment? Could it be, that psql client packs IP address of the client into athentication data? Regards, Bohdan ---(end of broadcast)--- TIP 5: don't forget

Re: [GENERAL] pg_autovacuum not sleeping

2005-09-21 Thread Brandon Metcalf
p == pgman@candle.pha.pa.us writes: p Brandon Metcalf wrote: ... p So, pg_autovacuum says it's going to sleep for 4886 seconds, but fires p up again after just under 600 seconds. p p Can anyone explain what I'm seeing? p Yep, this was fixed in 8.0.X CVS in May, two days after the

Re: [GENERAL] Problem with libpq3 postgresql8

2005-09-21 Thread Michael Fuhr
On Wed, Sep 21, 2005 at 04:18:33PM +0300, Devrim GUNDUZ wrote: On Wed, 21 Sep 2005, Alex R. Mosteo wrote: I have a client program which worked ok, using libpq3 agains a 7.4 database. Both linux versions. The client and server are in separate machines connecting via TCP/IP. I've just updated

[GENERAL] Problems with leftover types in pg_temp schemas

2005-09-21 Thread Janning Vygen
Hi, last week i asked a question about how to remove a left over pg_type from a temp table. http://archives.postgresql.org/pgsql-general/2005-09/msg00409.php Tom Lane helped me managing it by reindexing pg_depends and DROPping the pg_temp_X.temp_gc. Now i have the same problem again but with

Re: [GENERAL] pgclient hostbased authentication

2005-09-21 Thread A. Kretschmer
am 21.09.2005, um 15:53:45 +0200 mailte Bohdan Linda folgendes: Hello, may I ask, how(or which) ip is checked against pg_hba.conf IP entry in NAT environment? Could it be, that psql client packs IP address of the client into athentication data? No. Why? Describe your problem.

Re: [GENERAL] pgclient hostbased authentication

2005-09-21 Thread Magnus Hagander
Hello, may I ask, how(or which) ip is checked against pg_hba.conf IP entry in NAT environment? Could it be, that psql client packs IP address of the client into athentication data? No, it validates the source address on the TCP connection. In the event of NAT, it will check the NATted

Re: [GENERAL] running vacuum in scripts

2005-09-21 Thread Belinda M. Giardine
On Tue, 20 Sep 2005, Jim C. Nasby wrote: On Tue, Sep 20, 2005 at 11:04:44AM -0400, Belinda M. Giardine wrote: For vacuuming, you could try to use the autovacuum daemon, it is included in the contrib part of postgres. If you installed from source, you will likely need to separately

Re: [GENERAL] pg_index_indrelid_index error, any ideas ??

2005-09-21 Thread Tom Lane
[EMAIL PROTECTED] writes: I've got an error from postgresql server - ERROR: root page 1 of pg_index_indrelid_index has level 512, expected 0 This error appears on every command and i can't do anything with my database. Is it possible to solve this problem ? See REINDEX. Also you ought to

Re: [GENERAL] Problems with leftover types in pg_temp schemas

2005-09-21 Thread Tom Lane
Janning Vygen [EMAIL PROTECTED] writes: the problem is quite urgent because i can't afford the time for rewriting the app to not use temp tables. So i need to fix it. any help is very appreciated. Show us a self-contained test case. regards, tom lane

[GENERAL] Network Flow Schema + Bulk Import/Updates

2005-09-21 Thread Michael L. Artz
I'm fairly new at Postgres and had some basic design questions. My problem is basically that I want to do large bulk imports (millions of rows) into a large DB (billions of rows) where there might already be data that needs to be updated instead of inserting a new row. I read a similar post a

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-21 Thread Tony Wasson
On 9/20/05, Matthew Peter [EMAIL PROTECTED] wrote: Wondering if there's a way for postgres to return how many elements are in a array as a single integer? For instance, returning 10 (items in array) instead of [-5:4] Also, is there a way to return the position of an item in a array? Try

Re: [GENERAL] Slow search.. quite clueless

2005-09-21 Thread Olly Betts
Yonatan Ben-Nes wrote: Actually I even started to look on other solutions and maybe you can say something about them also.. maybe they can help me: 1. Omega (From the Xapian project) - http://www.xapian.org/ You could certainly do this with Xapian and Omega. With only 5 million records it

Re: [GENERAL] Errror in beltane

2005-09-21 Thread Hartel, Dirk
-Original Message- From: Hartel, Dirk Sent: 20 September 2005 15:28 To: '[EMAIL PROTECTED]' Subject: Errror in beltane Hi all, I use yule as intrusion detection system and beltane as frontend. All data are in a postgresql DB. Yule writes all data without error

Re: [GENERAL] Problem with libpq3 postgresql8

2005-09-21 Thread Alex R. Mosteo
Michael Fuhr wrote: On Wed, Sep 21, 2005 at 04:18:33PM +0300, Devrim GUNDUZ wrote: On Wed, 21 Sep 2005, Alex R. Mosteo wrote: I have a client program which worked ok, using libpq3 agains a 7.4 database. Both linux versions. The client and server are in separate machines connecting via TCP/IP.

Re: [GENERAL] Win32 Backup and Restore of large databases.

2005-09-21 Thread Lincoln Yeoh
At 12:24 PM 9/21/2005 +0100, Howard Cole wrote: On a Win32 machine, can I backup a database if the backup file exceeds 2GB? In linux, I can split the backup file into multiple files. Can this be done on Win32? Max file size depends on file system used.

Re: [GENERAL] pgclient hostbased authentication

2005-09-21 Thread Bohdan Linda
No. Why? Describe your problem. I have got response like bellow, when connecting to server in completely different network than 172.x.x.x -- org.postgresql.util.PSQLException: Connection rejected: FATAL: no pg_hba.conf entry for host 172.x.x.x, user XxXxXx, database yYyYyY, SSL off

[GENERAL] connecting windows xp to remote server

2005-09-21 Thread Jeanne Thibeault
Hi- I need to be able to access a database on a remote Unix server (postgres 7.4) with my Windows computer that runs on XP home. I installed postgresql 8.0.3 and have the PostgreSQL driver available in my ODBC Administrator. Apparently I need to be able to send my password as md5 encrypted, but

[GENERAL] How to create case insensitive unique constraint

2005-09-21 Thread Andrus
I want to disable dupplicate customer names in a database regardless to case. I tried CREATE TABLE customer ( id SERIAL, name CHARACTER(70)); ALTER TABLE customer ADD constraint customer_name_unique UNIQUE (UPPER(name)); but this is not allowed in Postgres Any idea ? Andrus.

Re: [GENERAL] How to create case insensitive unique constraint

2005-09-21 Thread Csaba Nagy
I guess you can create a unique functional index with upper as the function. Try to look up the docs for CREATE INDEX. HTH, Csaba. On Wed, 2005-09-21 at 18:15, Andrus wrote: I want to disable dupplicate customer names in a database regardless to case. I tried CREATE TABLE customer ( id

[GENERAL] Postgres locks table schema?

2005-09-21 Thread Stas Oskin
Hi. When running SQL scripts, which change the tables' schema, we sometimes experience a lock of these tables' schema. The lock occurs on the first command of the script, on the first modified table. When this occurs, no further schema modification for this table is possible, until

Re: [GENERAL] How to create case insensitive unique constraint

2005-09-21 Thread John D. Burger
I want to disable dupplicate customer names in a database regardless to case. I tried CREATE TABLE customer ( id SERIAL, name CHARACTER(70)); ALTER TABLE customer ADD constraint customer_name_unique UNIQUE (UPPER(name)); but this is not allowed in Postgres As Csaba suggested, a unique

Re: [GENERAL] How to create case insensitive unique constraint

2005-09-21 Thread Andrus
You could use upper() similarly - lower() is better for Unicode data, like mine. John, thank you. Excellent. I have database encoding UNICODE. Why lower() is better than upper()? Andrus. ---(end of broadcast)--- TIP 9: In versions below

[GENERAL] Fetching column names for a table

2005-09-21 Thread Steve Manes
I need to extract a SETOF column names for a table in plpgsql. How is this done? -=oo- Steve Manes http://www.magpie.com Brooklyn, NY ---(end of broadcast)--- TIP 1: if posting/reading

Re: [GENERAL] Network Flow Schema + Bulk Import/Updates

2005-09-21 Thread Tony Wasson
On 9/20/05, Michael L. Artz [EMAIL PROTECTED] wrote: I'm fairly new at Postgres and had some basic design questions. My problem is basically that I want to do large bulk imports (millions of rows) into a large DB (billions of rows) where there might already be data that needs to be updated

[GENERAL] returning the primary key value

2005-09-21 Thread Jason Tesser
I have a stored proc in which I want to retur the primary key of an insert statement that the stored proc just ran. How can I do that? ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] Slow search.. quite clueless

2005-09-21 Thread Yonatan Ben-Nes
Oleg Bartunov wrote: On Tue, 20 Sep 2005, Philip Hallstrom wrote: contrib/tsearch2 ( http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/ ) might works for you. It might because performance depends on cardinality of your keywords. Seconded. We use tsearch2 to earch about 40,000 rows

Re: [GENERAL] Problem with libpq3 postgresql8

2005-09-21 Thread Tom Lane
Alex R. Mosteo [EMAIL PROTECTED] writes: About the certificate thing, I'm not sure what you mean, but I've configured the pg_hba.conf file useing hostnossl. I see this line in the server log: LOG: no se pudo aceptar una conexión SSL: se detectó EOF Which translates to: Couldn't accept a SSL

Re: [GENERAL] Fetching column names for a table

2005-09-21 Thread Philip Hallstrom
I need to extract a SETOF column names for a table in plpgsql. How is this done? Start up psql with the -E option. Then type \dt tablename. This will print out the SQL that psql runs to give you the column names. Maybe that will do what you want? -philip ---(end

Re: [GENERAL] Postgres locks table schema?

2005-09-21 Thread Tom Lane
Stas Oskin [EMAIL PROTECTED] writes: When running SQL scripts, which change the tables' schema, we sometimes experience a lock of these tables' schema. The lock occurs on the first command of the script, on the first modified table. When this occurs, no further schema modification for this

Re: [GENERAL] Fetching column names for a table

2005-09-21 Thread Tony Wasson
On 9/21/05, Steve Manes [EMAIL PROTECTED] wrote: I need to extract a SETOF column names for a table in plpgsql. How is this done? I got the queries for this by running psql with -E and then using \d on a table. Use this function like so: SELECT * FROM column_names('your_table'); CREATE OR

Re: [GENERAL] Fetching column names for a table

2005-09-21 Thread Joshua D. Drake
Steve Manes wrote: I need to extract a SETOF column names for a table in plpgsql. How is this done? A query such as this: select * from information_schema.columns where table_name = 'table_name'; Will give you a bunch of information. For SET OF functions in general take a look at:

Re: [GENERAL] Postgres locks table schema?

2005-09-21 Thread Scott Marlowe
On Wed, 2005-09-21 at 12:51, Stas Oskin wrote: Hi. When running SQL scripts, which change the tables' schema, we sometimes experience a lock of these tables' schema. The lock occurs on the first command of the script, on the first modified table. When this occurs, no further schema

Re: [GENERAL] Fetching column names for a table

2005-09-21 Thread David Fetter
On Wed, Sep 21, 2005 at 02:31:23PM -0400, Steve Manes wrote: I need to extract a SETOF column names for a table in plpgsql. How is this done? You can do it in SQL. CREATE OR REPLACE FUNCTION get_columns_for ( in_schema TEXT, in_table TEXT ) RETURNS SETOF TEXT LANGUAGE SQL STRICT AS $$

[GENERAL] COPY and Unicode...

2005-09-21 Thread Cristian Prieto
Hello, I need to import some amount of data using the COPY command, the main trouble I found is that the Database is in UNICODE format and the data in ASCII Latin-1 codepage, when I try to import it, COPY respond with: ERROR: invalid byte sequence for encoding UNICODE: 0xe9 CONTEXT: COPY

[GENERAL] index row size exceeds btree maximum

2005-09-21 Thread CSN
This appears related to my previous post: http://archives.postgresql.org/pgsql-general/2005-09/msg00809.php I setup a unique index using the title, yield, and directions fields. Some inserts are causing this error: DBD::Pg::st execute failed: ERROR: index row size 2832 exceeds btree maximum,

[GENERAL] YAPC::Israel looking for Perl/Database speakers

2005-09-21 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 NotDashEscaped: You need GnuPG to verify this message The call for papers for YAPC::Israel is out. Note that they specifically mention databases. It would be nice if someone could present something on Pl/perl there. I'll even volunteer to help write

Re: [GENERAL] index row size exceeds btree maximum

2005-09-21 Thread Scott Marlowe
On Wed, 2005-09-21 at 15:02, CSN wrote: This appears related to my previous post: http://archives.postgresql.org/pgsql-general/2005-09/msg00809.php I setup a unique index using the title, yield, and directions fields. Some inserts are causing this error: DBD::Pg::st execute failed:

Re: [GENERAL] index row size exceeds btree maximum

2005-09-21 Thread CSN
--- Scott Marlowe [EMAIL PROTECTED] wrote: On Wed, 2005-09-21 at 15:02, CSN wrote: This appears related to my previous post: http://archives.postgresql.org/pgsql-general/2005-09/msg00809.php I setup a unique index using the title, yield, and directions fields. Some inserts are

Re: [GENERAL] COPY and Unicode...

2005-09-21 Thread Douglas McNaught
Cristian Prieto [EMAIL PROTECTED] writes: Hello, I need to import some amount of data using the COPY command, the main trouble I found is that the Database is in UNICODE format and the data in ASCII Latin-1 codepage, when I try to import it, COPY respond with: ERROR: invalid byte sequence

Re: [GENERAL] COPY and Unicode...

2005-09-21 Thread Tom Lane
Cristian Prieto [EMAIL PROTECTED] writes: Hello, I need to import some amount of data using the COPY command, the main trouble I found is that the Database is in UNICODE format and the data in ASCII Latin-1 codepage, when I try to import it, COPY respond with: ERROR: invalid byte sequence

Re: [GENERAL] [pgsql-advocacy] YAPC::Israel looking for Perl/Database speakers

2005-09-21 Thread David Fetter
On Wed, Sep 21, 2005 at 08:07:48PM -, Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 NotDashEscaped: You need GnuPG to verify this message The call for papers for YAPC::Israel is out. Note that they specifically mention databases. It would be nice if

Re: [GENERAL] COPY and Unicode...

2005-09-21 Thread Cristian Prieto
Thanks a lot! Your help was very handy! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Douglas McNaught Sent: Miércoles, 21 de Septiembre de 2005 02:39 p.m. To: Cristian Prieto Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] COPY and Unicode...

Re: [GENERAL] Slow search.. quite clueless

2005-09-21 Thread Yonatan Ben-Nes
Olly Betts wrote: Yonatan Ben-Nes wrote: Actually I even started to look on other solutions and maybe you can say something about them also.. maybe they can help me: 1. Omega (From the Xapian project) - http://www.xapian.org/ You could certainly do this with Xapian and Omega. With only 5

Re: [GENERAL] Slow search.. quite clueless

2005-09-21 Thread Dawid Kuroczko
On 9/20/05, Yonatan Ben-Nes [EMAIL PROTECTED] wrote: Hi all,Im building a site where the users can search for products with up to 4diffrent keywords which all MUST match to each product which found as aresult to the search.I got 2 tables (which are relevant to the issue :)), one is the product

Re: [GENERAL] Problem with libpq3 postgresql8

2005-09-21 Thread vishal saberwal
hi, tom and many others helped me with someting similar to this. Check for the following: (a) in /usr/lib check what libpq you have installed. It should be libpq3.2 or higher. If it is not, you can copy from your compiled source and then create the symbolic links there. (b) Try using etheral and

Re: [GENERAL] Network Flow Schema + Bulk Import/Updates

2005-09-21 Thread Michael L. Artz
Tony Wasson wrote: You can use the merge trigger below to do this. You'll need to add some code to update the count. You may also benefit from using the new constraint exclusion (table partitioning) in PostgreSQL 8.1. I am not sure if CE works against the inet datatype -- if not, try converting

Re: [GENERAL] JDBC error w/ WebObjects

2005-09-21 Thread Ismael Perdido
Hi there, I am getting an error when I try to update or delete rows in my postgreSQL table. I am using: Eclipse WO5.2 Postgres8.0 JDBC3 Hexdreams 1.2 plugin The error message is horribly vauge: com.webobjects.eoaccess.EOGeneralAdaptorException: updateValuesInRowDescribedByQualifier --

Re: [GENERAL] returning the primary key value

2005-09-21 Thread Michael Fuhr
On Wed, Sep 21, 2005 at 02:22:22PM -0500, Jason Tesser wrote: I have a stored proc in which I want to retur the primary key of an insert statement that the stored proc just ran. How can I do that? If the primary key is a SERIAL column then see How do I get the value of a SERIAL insert? in