I would dearly love to do
CREATE GROUP foo WITH USER CURRENT_USER;
in a script to psql(1), but this does not appear to be supported by the parser.
Two questions:
1. Does anybody have a good work-around for this?
2. Is there a document somewhere that says where functions are allowed in SQL
I would like to create a FOREIGN KEY constraint to an inherited column, like:
test=# CREATE TABLE foo(id INTEGER PRIMARY KEY);
test=# CREATE TABLE bar() INHERITS (foo);
test=# CREATE TABLE baz (bar INTEGER, CONSTRAINT fk_bar FOREIGN KEY (bar)
REFERENCES bar(id));
ERROR: UNIQUE c
I obviously haven't had enough coffee yet... :-) The following script works as
expected.
drop database test;
create database test;
\c test
create table foo (id integer primary key);
create table bar () inherits (foo);
create unique index bar_id_idx ON bar(id);
create table baz (bar integer,
On Sun, 5 Aug 2001, Allan Engelhardt wrote:
> test=# create table baz(bar integer, constraint fk_bar foreign key (bar)
>references foo(id));
> NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
> CREATE
>
> but this is not exactly what I want: I need to e
Stephan Szabo wrote:
> On Sun, 5 Aug 2001, Allan Engelhardt wrote:
[see new example below]
> Not that this is related to what you asked about precisely (I saw the
> response you made), but the query above also doesn't do what you think
> it does right now. It currently makes a reference to onl
05 Aug 2001 13:49:22 +0100, Allan Engelhardt
> I would like to create a FOREIGN KEY constraint to an inherited column, like:
>
> test=# CREATE TABLE foo(id INTEGER PRIMARY KEY);
> test=# CREATE TABLE bar() INHERITS (foo);
> test=# CREATE TABLE baz (bar INTEGER, CONSTRAINT fk_bar
Gonzo Rock writes:
> I'm trying to find a pgSQL source that documents the Non-Standard
> pgSQL stuff, the stuff that will break when attempting to execute
> against mySQL/Oracle/MSSQLServer etc...
While it would be an appreciated effort to create such a document (and we
already try to document s
Josh Berkus writes:
> For many of my programs, it would be extremely useful to have some form
> of "fuzzy matching" for VARCHAR fields.
For lexical similarity, check out the agrep algorithm. Last I checked the
source code wasn't quite Free(tm), but the algorithm was published in an
academic wor
Dimitri pointed out (the post does not seem to have appered yet) that you can also do:
test=# create table foo(id integer primary key);
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'foo_pkey' for table
'foo'
CREATE
test=# create table bar () inherits (foo);
Tom, Stephan,
I'm writing up the date/time FAQ, and I came across some operator
behavior that confuses me:
If
INTERVAL / INTEGER = INTERVAL
then why does
INTERVAL / INTERVAL = ERROR?
Shouldn't
INTERVAL / INTERVAL = INTEGER?
I'd like to answer this before I finish the FAQ, as it seems
inconsis
Gonzo,
> > I'm trying to find a pgSQL source that documents the Non-Standard
> > pgSQL stuff, the stuff that will break when attempting to execute
> > against mySQL/Oracle/MSSQLServer etc...
Almost anything you port will break MS SQL Server (7.0 and 6.5, anyway).
SQL Server is so far off the ANS
Josh Berkus wrote:
> This is a multi-part MIME message
>
> --_===97089davinci.ethosmedia.com===_
> Content-Type: text/plain; charset="ISO-8859-1"
> Content-Transfer-Encoding: 8bit
>
> Tom, Stephan,
>
> I'm writing up the date/time FAQ, and I came across some operator
> behavior that confuses
"Josh Berkus" <[EMAIL PROTECTED]> writes:
> If
> INTERVAL / INTEGER = INTERVAL
Actually the operator appears to be INTERVAL / FLOAT8.
> then why does
> INTERVAL / INTERVAL = ERROR?
Because no one got around to creating an INTERVAL / INTERVAL operator.
There are plenty of such gaps in our operat
Tom,
> > then why does
> > INTERVAL / INTERVAL = ERROR?
>
> Because no one got around to creating an INTERVAL / INTERVAL
> operator.
> There are plenty of such gaps in our operator set...
Bummer. If I could "C" then maybe I'd do something about it.
>
> > Shouldn't
> > INTERVAL / INTERVAL = I
Allan Engelhardt <[EMAIL PROTECTED]> writes:
> I don't think it makes conceptual sense to divide intervals
It is kinda bogus, given the underlying semantics of intervals
(integer months plus float seconds). The problem already arises
for the existing interval * float8 and interval / float8 o
Tom Lane writes:
> It is kinda bogus, given the underlying semantics of intervals
> (integer months plus float seconds).
> This is pretty grotty, and AFAIK not documented anywhere --- I found it
> out by looking at the C code for these operators. But I'm not sure
> how to do better.
One day we
Peter Eisentraut <[EMAIL PROTECTED]> writes:
> One day we will have to accept the fact that months and seconds must not
> be mixed, period. You can have year/month intervals or
> day/hour/minute/second intervals, not a combination. An interval of '5
> years 3 minutes' has no meaning with the nat
Tom Lane writes:
> I don't agree --- five years and three minutes is perfectly meaningful.
> There are only certain things you can validly do with it, however, and
> scaling by a floating-point number isn't one of them, because fractional
> months aren't well-defined. But you can, for example, a
Peter Eisentraut <[EMAIL PROTECTED]> writes:
> but
> '2001-08-06 03:03:03' - '2000-08-06 03:03:00' = '365 days 3 seconds'
> '2000-08-06 03:03:03' - '1999-08-06 03:03:00' = '366 days 3 seconds'
What I said was that timestamp plus or minus interval is well-defined
(when "interval" is a multi-part
19 matches
Mail list logo