[SQL] INSERT INTO...RETURNING vs SELECT

2010-04-06 Thread Cliff Wells
I was doing some experimenting and was wondering why the following does not work: CREATE TABLE accounts ( id SERIAL PRIMARY KEY NOT NULL, accounts_id INTEGER REFERENCES accounts, name TEXT ); INSERT INTO accounts (accounts_id, name) VALUES ( (INSERT INTO accounts (accounts_id, name) VALUE

Re: [SQL] INSERT INTO...RETURNING vs SELECT

2010-04-05 Thread Cliff Wells
On Mon, 2010-04-05 at 09:10 +0200, Andreas Kretschmer wrote: > Cliff Wells wrote: > > > As far as I can see, INSERT INTO...RETURNING is semantically equivalent > > to SELECT...FROM with a side-effect, so it seems this construct should > > work. Can someone shed some

[SQL] INSERT INTO...RETURNING vs SELECT

2010-04-04 Thread Cliff Wells
I was doing some experimenting and was wondering why the following does not work: CREATE TABLE accounts ( id SERIAL PRIMARY KEY NOT NULL, accounts_id INTEGER REFERENCES accounts, name TEXT ); INSERT INTO accounts (accounts_id, name) VALUES ( (INSERT INTO accounts (accounts_id, name) VALUE

Re: [SQL] Home-brewed table syncronization

2003-07-09 Thread Cliff Wells
hange from time-to-time, but just the process of determining > what is different may take more effort than simply rebuilding. Keep a timestamp associated with each record. Only update the records with timestamps later than your last sync. -- Cliff Wells, Software Engineer Logiplex Corporatio

Re: [SQL] [ADMIN] Incredible..

2002-06-21 Thread Cliff Wells
On Fri, 21 Jun 2002 09:57:20 -0500 Luis Andaluz P, wrote: > Hello, > see this interesting file. > Bye. > And see this interesting URL: http://www.brocku.ca/its/helpdesk/virusalerts/viruses.phtml?vid=75 -- Cliff Wells, Software Engineer Logiplex Corporation (www.logiplex.net) (5

Re: [SQL] skip weekends

2002-06-21 Thread Cliff Wells
On Thu, 2002-06-20 at 23:08, Rudi Starcevic wrote: > Hello, > > Nice reply Josh. > I wouldn't call your solution 'ugly' at all. > > It's an excellent example of a real world need for Postgresql functions. > I've also been looking at other functions at > http://www.brasileiro.net/postgres/cookbo