On Thursday 15 Aug 2002 8:13 am, Andreas Tille wrote:
> On Wed, 14 Aug 2002, Tom Lane wrote:
> > CREATE TABLE without mentioning the default
> > CREATE FUNCTION
> > ALTER TABLE ... SET DEFAULT
> >
> > Note however that pg_dump is not bright enough to deduce that you did
> > this. It w
On Wed, 14 Aug 2002, Tom Lane wrote:
> I concur with Richard that Andreas needs to solve a different problem,
> but just for the record, the way you could do it is
>
> CREATE TABLE without mentioning the default
>
> CREATE FUNCTION
>
> ALTER TABLE ... SET DEFAULT
>
> Note howeve
On Wed, 14 Aug 2002 Richard Huxton wrote:
> > CREATE TABLE Items (
> > Idint DEFAULT NextItem()
>
> > CREATE FUNCTION NextItem() RETURNS INT4
> > AS 'select max(Id)+1 from Items where Id < 100;'
> > LANGUAGE 'sql';
>
> >ERROR: Relation "items" does not exist
> >
> > Any hin
Richard Huxton <[EMAIL PROTECTED]> writes:
> On Wednesday 14 Aug 2002 10:30 am, Andreas Tille wrote:
>> Any hint to solve this kind of chicken-egg-problem?
> Your solution is not safe anyway - you could end up with two processes trying
> to insert the next value.
I concur with Richard that Andre
On Wednesday 14 Aug 2002 10:30 am, Andreas Tille wrote:
> Hello,
>
> I want to insert new data into a table with increasing data set ids.
> The table has two separate "regions" of data: Those with Ids below
> 100 and other. If I want to create a new Id in the "lower region"
> I tried the foll
Hello,
I want to insert new data into a table with increasing data set ids.
The table has two separate "regions" of data: Those with Ids below
100 and other. If I want to create a new Id in the "lower region"
I tried the following (simplified example):
CREATE TABLE Items (
Idint DEFA