[SQL] pg & Delphi

2007-08-27 Thread Kitter Georgiy
Good day. I want to enter Postges into project, which has so rectriction, that client should be written on Delphi (CBuilder). Please, prompt me how to adjust Delphi to use Postgres. Dmitry Turin SQL4 (4.2.0) http://sql40.chat.ru HTML6 (6.4.0) http://html60.chat.ru Unicode2 (2.0.1

[SQL] Request into several DBMS simultaneously on DDL and DML

2007-08-27 Thread Kitter Georgiy
(1)Let's allow to __connect into several DBMS__ at once, last of them becomes DBMS 'by default'. User assign any nickname to each database at connection, except nickname 'all' and 'local', e.g. connect ra=database.remote.com username=Smith password=pwds nickname=db1; connect ra=db.distination

Re: [SQL] [GENERAL] table column vs. out param [1:0]

2007-08-27 Thread Kristo Kaiv
On 27.08.2007, at 18:07, Tom Lane wrote: Kristo Kaiv <[EMAIL PROTECTED]> writes: From http://www.postgresql.org/docs/current/static/plpgsql- declarations.html#PLPGSQL-DECLARATION-RENAMING-VARS Note: RENAME appears to be broken as of PostgreSQL 7.3. Fixing this is of low priority, since ALIAS c

Re: [SQL] fetch first rows of grouped data

2007-08-27 Thread Michael Glaesemann
On Aug 27, 2007, at 13:12 , Michael Glaesemann wrote: select city, event, event_date, ( select count(event) from events i where i.city = o.city and i.event_date < o.event_date and event_date > current_date -- make sure they're future events This should be i.event

Re: [SQL] fetch first rows of grouped data

2007-08-27 Thread D'Arcy J.M. Cain
On Mon, 27 Aug 2007 13:34:09 -0400 Joel Richard <[EMAIL PROTECTED]> wrote: > That's what I thought at first, but this is not the case. She's > looking for the first two dates in -each- city in the table. I > initially thought that this could be accomplished with GROUP BY and > LIMIT, but GROU

Re: [SQL] fetch first rows of grouped data

2007-08-27 Thread Michael Glaesemann
[Please don't top post as it makes the discussion more difficult to follow.] On Aug 27, 2007, at 12:34 , Joel Richard wrote: On Aug 27, 2007, at 12:51 PM, D'Arcy J.M. Cain wrote: On Mon, 27 Aug 2007 18:36:47 +0200 Claudia Kosny <[EMAIL PROTECTED]> wrote: I have a list of events that take p

Re: [SQL] fetch first rows of grouped data

2007-08-27 Thread Joel Richard
That's what I thought at first, but this is not the case. She's looking for the first two dates in -each- city in the table. I initially thought that this could be accomplished with GROUP BY and LIMIT, but GROUP BY can only give you the first date for each city, not the first two dates for

Re: [SQL] fetch first rows of grouped data

2007-08-27 Thread D'Arcy J.M. Cain
On Mon, 27 Aug 2007 18:36:47 +0200 Claudia Kosny <[EMAIL PROTECTED]> wrote: > I have a list of events that take place in a certain city at a certain > date. Now I would like to have the first two (ordered by date) events > for each city. > > Is there a way to do this with one query? > I am using

[SQL] fetch first rows of grouped data

2007-08-27 Thread Claudia Kosny
Hi there I have a list of events that take place in a certain city at a certain date. Now I would like to have the first two (ordered by date) events for each city. Is there a way to do this with one query? I am using PostgreSQL 7.4. Thanks for any tips. Claudia -

Re: [SQL] Block size with pg_dump?

2007-08-27 Thread Jean-David Beyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bruce Momjian wrote: > Jean-David Beyer wrote: > The main question is, If I present pg_restore with a 65536-byte > blocksize > and it is expecting, e.g., 1024-bytes, will the rest of each block get > skipped? I.e., do I have to use dd

Re: [SQL] [GENERAL] table column vs. out param [1:0]

2007-08-27 Thread Tom Lane
Kristo Kaiv <[EMAIL PROTECTED]> writes: > From http://www.postgresql.org/docs/current/static/plpgsql- > declarations.html#PLPGSQL-DECLARATION-RENAMING-VARS > Note: RENAME appears to be broken as of PostgreSQL 7.3. Fixing this > is of low priority, since ALIAS covers most of the practical uses of

Re: [SQL] Block size with pg_dump?

2007-08-27 Thread Bruce Momjian
Jean-David Beyer wrote: > >>> The main question is, If I present pg_restore with a 65536-byte > >>> blocksize > >>> and it is expecting, e.g., 1024-bytes, will the rest of each block get > >>> skipped? I.e., do I have to use dd on the way back too? And if so, > >>> what > >>> should the blocksi

Re: [SQL] Block size with pg_dump?

2007-08-27 Thread Jean-David Beyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bruce Momjian wrote: > Erik Jones wrote: > On the way back, likewise I could pipe the tape through dd before > giving it > to pg_restore. > > Does pg_dump care what blocksize it gets? If so, what is it? I assume you could pip

[SQL] SQL function

2007-08-27 Thread ashok raj
Hi, Is there any function in postgre to know the size of the data in a row of a table ?

Re: [SQL] List of FKeys ?

2007-08-27 Thread Ashish Karalkar
- Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "Andreas" <[EMAIL PROTECTED]> Cc: Sent: Monday, August 27, 2007 9:18 AM Subject: Re: [SQL] List of FKeys ? Andreas <[EMAIL PROTECTED]> writes: could I get a list of foreign keys that refer to a column? The information_

Re: [SQL] [GENERAL] table column vs. out param [1:0]

2007-08-27 Thread Kristo Kaiv
On 23.08.2007, at 11:55, Albe Laurenz wrote: CREATE FUNCTION b(status OUT integer, status_text OUT text) LANGUAGE plpgsql STABLE STRICT AS $$DECLARE RENAME status TO out_status; RENAME status_text TO out_status_text; BEGIN SELECT status, status_text FROM a() INTO out_statu