Re: [GENERAL] books/sites for someone really learning PG's advanced

2004-09-23 Thread Mike Mascari
Miles Keaton wrote: I'm switching to PostgreSQL from MySQL. Using the SAMs book called PostgreSQL which has been great to skim the surface of the differerences. I had never even heard of things like triggers, views, and foreign keys before. Any recommended books or websites (or exercises) that wou

[GENERAL] books/sites for someone really learning PG's advanced features?

2004-09-23 Thread Miles Keaton
I'm switching to PostgreSQL from MySQL. Using the SAMs book called PostgreSQL which has been great to skim the surface of the differerences. I had never even heard of things like triggers, views, and foreign keys before. Any recommended books or websites (or exercises) that would really help som

Re: [GENERAL] default value problem in postgresql 7.4.5-2

2004-09-23 Thread Tom Lane
Frans <[EMAIL PROTECTED]> writes: > I set the default value to '1900-01-01 00:00:00' , but the result is >'1900-01-01 00:00:00'::timestamp without time zone Why is this a problem? regards, tom lane ---(end of broadcast)

[GENERAL] default value problem in postgresql 7.4.5-2

2004-09-23 Thread Frans
Hello All, I have just upgrade my postgresql to 7.4.5-2, but I have problem with default value in postgresql 7.4.5-2, everytime I set default value for varchar or timestamp fields, the result value always change to sometihing like this : I set the default value to '1900-01-01 00:00:00' , but the r

Re: [GENERAL] Restore a especific function

2004-09-23 Thread Thomas F . O'Connell
There's also pg_restore -P. See: http://www.postgresql.org/docs/7.4/static/app-pgrestore.html -tfo On Sep 23, 2004, at 7:34 PM, Alvaro Herrera wrote: On Thu, Sep 23, 2004 at 02:57:30PM -0600, Josué Maldonado wrote: Hola, Is there a way to restore a specific function from backup file created with pg

Re: [GENERAL] data modeler

2004-09-23 Thread Matthew Hixson
On Sep 23, 2004, at 7:19 PM, Alvaro Herrera wrote: On Thu, Sep 23, 2004 at 07:02:26PM -0700, Matthew Hixson wrote: I'm looking for a data modeler that can look at an existing database schema and generate an ERD. A PDF of it would be nice. I'm using OS X, but a Linux or Windows tool would be accep

Re: [GENERAL] data modeler

2004-09-23 Thread Alvaro Herrera
On Thu, Sep 23, 2004 at 07:02:26PM -0700, Matthew Hixson wrote: > I'm looking for a data modeler that can look at an existing database > schema and generate an ERD. A PDF of it would be nice. I'm using OS > X, but a Linux or Windows tool would be acceptable too. I don't need > any other featu

[GENERAL] data modeler

2004-09-23 Thread Matthew Hixson
I'm looking for a data modeler that can look at an existing database schema and generate an ERD. A PDF of it would be nice. I'm using OS X, but a Linux or Windows tool would be acceptable too. I don't need any other features than that right now. Just want to generate something that new deve

Re: [GENERAL] self referencing table structure and constraints

2004-09-23 Thread Matthew Hixson
On Sep 23, 2004, at 6:36 PM, Stephan Szabo wrote: On Thu, 23 Sep 2004, Matthew Hixson wrote: I have a categories table that contains a FK to another category in the same table, creating a hierarchy. At the very top is this row: category_id | name | description | parent_id -

Re: [GENERAL] self referencing table structure and constraints

2004-09-23 Thread Stephan Szabo
On Thu, 23 Sep 2004, Matthew Hixson wrote: > I have a categories table that contains a FK to another category in the > same table, creating a hierarchy. At the very top is this row: > > category_id | name | description | parent_id > -+--+-+--

Re: [GENERAL] Returning recordsets with functions

2004-09-23 Thread Stephan Szabo
On Thu, 23 Sep 2004, Robert Fitzpatrick wrote: > Can someone point me to some more information or perhaps show an example > of returning a recordset from a plpgsql function. I'd like to send an > argument or arguments to the function, do some queries to return a set > of records. I've done severa

[GENERAL] self referencing table structure and constraints

2004-09-23 Thread Matthew Hixson
I have a categories table that contains a FK to another category in the same table, creating a hierarchy. At the very top is this row: category_id | name | description | parent_id -+--+-+--- 1 | ROOT | The top level category

Re: [GENERAL] Returning recordsets with functions

2004-09-23 Thread Joshua D. Drake
Hello, When using setOf functions you first create a type to call from: CREATE TYPE desc_results AS (entry_id INTEGER, headline TEXT, rank REAL); After creating the custom type you create a function that calls that type: CREATE OR REPLACE FUNCTION dresults(text) RETURNS SETOF desc_resul

Re: [GENERAL] Returning recordsets with functions

2004-09-23 Thread Robert Fitzpatrick
On Thu, 2004-09-23 at 18:28, Tim Penhey wrote: > Robert Fitzpatrick wrote: > > >Can someone point me to some more information or perhaps show an example > >of returning a recordset from a plpgsql function. I'd like to send an > >argument or arguments to the function, do some queries to return a s

Re: [GENERAL] need ``row number``

2004-09-23 Thread Ian Harding
You are going to need a set returning function. It will have to look up the expected boosters, the expected time elapsed, and return them with their sequence numbers if they exists. There is no easy way to do it in a view that I can think of. <<< Karsten Hilbert <[EMAIL PROTECTED]> 9/23 1:56

Re: [GENERAL] Restore a especific function

2004-09-23 Thread Alvaro Herrera
On Thu, Sep 23, 2004 at 02:57:30PM -0600, Josué Maldonado wrote: Hola, > Is there a way to restore a specific function from backup file created > with pg_dump. If you used pg_dump -Ft or -Fc, you do it with pg_restore -L/-l. Otherwise (i.e. plain SQL dump) you have to edit the dump with a text

[GENERAL] FW: Re: ruby-postgresql extension for windows

2004-09-23 Thread Verbus M. Counts
Found on ruby-talk: From: Justin Rudd <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] (ruby-talk ML) Subject: Re: ruby-postgresql extension for windows Date: Fri, 24 Sep 2004 02:41:46 +0900 > Anybody know how can I use ruby-postgresql extension in Windows? I need > a doc or

Re: [GENERAL] Returning recordsets with functions

2004-09-23 Thread Tim Penhey
Robert Fitzpatrick wrote: Can someone point me to some more information or perhaps show an example of returning a recordset from a plpgsql function. I'd like to send an argument or arguments to the function, do some queries to return a set of records. I've done several functions that return one val

[GENERAL] Restore a especific function

2004-09-23 Thread Josué Maldonado
Hello list, Is there a way to restore a specific function from backup file created with pg_dump. Thanks in advance, -- Sinceramente, Josué Maldonado. "La monogamia es como estar obligado a comer papas fritas todos los dias." -- Henry Miller. (1891-1980) Escritor estadounidense.

[GENERAL] need "row number"

2004-09-23 Thread Karsten Hilbert
Hello all, yes, I know, "row number" isn't a concept that fits into the relational model and I will only be asking for something similar. explanation (actual views below) I have a view that holds the vaccinations scheduled for a patient (v_vaccs_scheduled4pat) de

Re: [GENERAL] Comparing a varchar of length > 32

2004-09-23 Thread Gaetano Mendola
Christian Enklaar wrote: Hello, we are using a table with a primary key of type varchar[50]. If we try to find entries with select * from where = ''; entries with a key length of more than 32 characters are not found. Entries with a shorter key are found. Using "Like" instead of "=" works for var

Re: [GENERAL] Comparing a varchar of length > 32

2004-09-23 Thread Peter Eisentraut
Christian Enklaar wrote: > we are using a table with a primary key of type varchar[50]. > If we try to find entries with select * from where > = ''; > entries with a key length of more than 32 characters are not found. > Entries with a shorter key are found. Using "Like" instead of "=" > works fo

[GENERAL] Comparing a varchar of length > 32

2004-09-23 Thread Christian Enklaar
Hello, we are using a table with a primary key of type varchar[50]. If we try to find entries with select * from where = ''; entries with a key length of more than 32 characters are not found. Entries with a shorter key are found. Using "Like" instead of "=" works for varchar keys with length >

Re: [GENERAL] mailing list archive search form broken?

2004-09-23 Thread Greg Stark
Kevin Murphy <[EMAIL PROTECTED]> writes: > I receive the error message "Try to compose a less restrictive search query or > check spelling" regardless of search term when attempting to search the list > "PgSQL - General" via the mailing list archive search form at: Try leaving the "For files mod

Re: [GENERAL] How do I disable: Adding missing FROM-clause

2004-09-23 Thread Tom Lane
<[EMAIL PROTECTED]> writes: > I searched and found references to changing the postgresql.conf with: > add_missing_from = false This is correct. > enable_implicited_join = false This is not. > But neither one of these seems to disable the functionality (I did a reload after > making the change)

[GENERAL] How do I disable: Adding missing FROM-clause

2004-09-23 Thread terry
I know that PSQL has the cool feature of doing: Adding missing FROM-clause But I want to disable it, because its silent adding can allow a bad SQL statement to execute a cartesian select (when in fact it should error out). I searched and found references to changing the postgresql.conf with: add

Re: Réf. : Re: [GENERAL] v8 on AIX5.2

2004-09-23 Thread Tom Lane
[EMAIL PROTECTED] writes: > Contents of config.log is: > configure:16063: checking for the pthreads library -lpthreads > configure:16101: gcc -o conftest -O2 -fno-strict-aliasing conftest.c > -lpth > reads -lz -lreadline -lPW -lgen -lld -lnsl -ldl -lm >&5 > In file included from conftest.c:

Re: [GENERAL] Returning recordsets with functions

2004-09-23 Thread Kevin Barnard
Use the return type of SETOF and user the RETURN NEXT for each record. If you are already returning a record that's half the battle. http://www.postgresql.org/docs/7.4/static/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING On Thu, 23 Sep 2004 11:26:15 -0400, Robert Fitzpatrick <[EM

[GENERAL] using COPY table FROM STDIN within script run as psql -f file.sql

2004-09-23 Thread Kevin Murphy
This is a tip for the record in case it helps somebody else in the future. I have an import script that relies on a stored procedure that runs as a trigger on inserts into a temporary table. The script looks like this: -- create table -- ... -- define procedure and trigger -- ... -- import da

Réf. : Re: [GENERAL] v8 on AIX5.2

2004-09-23 Thread frederic . germaneau
I'm trying to evaluate PostgreSQL on AIX 5L(5.2) I have downloaded sources of PostgreSQL 8.0 beta 2. As described in documentation, I, first, launch "compile" then "gmake", and at least "gmake check". Without the option "--enable-thread-safety" all works fine. But in versions 5.2 and 5.3 of AI

Re: [GENERAL] using database for queuing operations?

2004-09-23 Thread Jeff Amiel
"The search condition of the command (the WHERE clause) is re-evaluated to see if the updated version of the row still matches the search condition. If so, the second updater proceeds with its operation, starting from the updated version of the row." Heythat's neat. All this time, I've don

[GENERAL] mailing list archive search form broken?

2004-09-23 Thread Kevin Murphy
I receive the error message "Try to compose a less restrictive search query or check spelling" regardless of search term when attempting to search the list "PgSQL - General" via the mailing list archive search form at: http://archives.postgresql.org/pgsql-general/ ---(en

[GENERAL] Returning recordsets with functions

2004-09-23 Thread Robert Fitzpatrick
Can someone point me to some more information or perhaps show an example of returning a recordset from a plpgsql function. I'd like to send an argument or arguments to the function, do some queries to return a set of records. I've done several functions that return one value of one type, but nothin