Hello,
I've a table in a database and I want to create a column that is a foreign
key to a table in an other database. When I try ...,foreign key (x)
references otherdb.table(x) it says 'parse error at or near "."'.
Is there an other way to create this kind of foreign key?
Stan van de Mortel
[[
No, I'm still at sea. Please help !
JACK
- Original Message -
From: "Justin Clift" <[EMAIL PROTECTED]>
To: "datactrl" <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 3:18 AM
Subject: Re: [GENERAL] install pgSQL 7.1
> Hi,
>
> Have people answered you regarding this?
>
> Regards and
And if you have plperl installed, something like this is even easier:
create function texttrim(text) returns text as '$_[0] =~ s/\\W//g; return
$_[0]' language 'plperl';
(I just read the docs) :-)
> -Original Message-
> From: Jeff Eckermann [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April
Regular expressions make this much easier. The below could be shortened to:
create function ComparisonString(text) returns text as '
declare
t alias for $1;
r text;
c char;
begin
if t is null or t !~ ''[^a-zA-Z0-9
Mark Stosberg wrote:
>
>
>
>Here's a situation I've run into more than once with SQL:
>
>I want to select all the rows in a table that match a criteria, where one
>of the criteria is possibly having a related entry in a second table. For
>my example, lets say I have table named 'me
On Mon, Apr 09, 2001 at 06:05:55PM +0100, Tim Johnson wrote:
> Hi,
>
> I have postgres 6.x (where x is something).
>
> I have the following list of data
>
> data
>
> ABC*
> ABC
> ABC-
...
> what I want to do is 'select distinct(data) [ignoring non alphanumeric
> characters] order by da
Joel Burton wrote:
> On Wed, 11 Apr 2001, Najm Hashmi wrote:
>
> > Hi All,
> > From pgsql, I try to insert data in table using the \i command. Nothing
> > takes place and after this command pgsql is hung... i cant use it any more.
> > The same command works with all other tables but this is o
Here's a situation I've run into more than once with SQL:
I want to select all the rows in a table that match a criteria, where one
of the criteria is possibly having a related entry in a second table. For
my example, lets say I have table named 'messages' and another named
'message_attachment
On Wed, 11 Apr 2001, Najm Hashmi wrote:
> Joel Burton wrote:
>
> > On Wed, 11 Apr 2001, Najm Hashmi wrote:
> >
> > > From pgsql, I try to insert data in table using the \i command. Nothing
> > > takes place and after this command pgsql is hung... i cant use it any more.
> > > The same comman
On Wed, 11 Apr 2001, Najm Hashmi wrote:
> Hi All,
> From pgsql, I try to insert data in table using the \i command. Nothing
> takes place and after this command pgsql is hung... i cant use it any more.
> The same command works with all other tables but this is only one I am having
> problem w
Thomas Lockhart wrote in comp.databases.postgresql.hackers:
> The parser does not know that your int4 constant "0" can be represented
> as an int2. Try
>
> SELECT * FROM access_log WHERE method_num = int2 '0';
>
> (note the type coersion on the constant; there are other ways of
> specifying t
SELECT name FROM test ORDER BY id DESC LIMIT 10;
Take care,
Jason
--- Wei Weng <[EMAIL PROTECTED]> wrote:
> Suppose I have a table
>
> create table test
> (
> id integer,
> name text
> );
>
> And I want to get the names of the largest 10 "id"s.
> How can I do that in
> sql?
Hi All,
From pgsql, I try to insert data in table using the \i command. Nothing
takes place and after this command pgsql is hung... i cant use it any more.
The same command works with all other tables but this is only one I am having
problem with.
I have attached my file with message. Could so
On Tue, 10 Apr 2001, Jaruwan Laongmal wrote:
> dear all,
> I currently using postgresql v7.0.3
> when i import text file to table with command "copy tablename from
> '/tmp/a.txt';
> and it shows
> "copy: line 20, Cannot insert a duplicate key into unique index testpri_pk"
> ,then it exits with do
On Tuesday, 10. April 2001 14:17, Amanda Riera wrote:
> I would like empty fields from a file being recognised as NULL
> values. It doesn't seem to work when a COPY is done, but when I make
> an INSERT without
> specifying the value, this is recognised as a NULL
>
> The file I want to copy is:
>
>
Hey Bruce,
Your book finally hit the bookshelves of Staten Island.
We have a Barnes and Noble here that actually has a reasonable
database section although it is misnamed 'Networking'. ;-)
I'll be getting my copy on payday - I found the sql examples
that I downloaded very useful and as I've been
Hi all,
I am using:
Debian 2.2 (kernel 2.2.18)
PgSQL version 7.0.3
I would like empty fields from a file being recognised as NULL values.
It doesn't seem to work when a COPY is done, but when I make an INSERT
without
specifying the value, this is recognised as a NULL
The file I want to copy is
Title: RE: [SQL] Sorting and then...
But if you want the largest 10, then you can:
SELECT name FROM ORDER BY id DESC LIMIT 10;
assuming that you mean largest numerically.
Cheers...
MikeA
>> -Original Message-
>> From: Roberto Mello [mailto:[EMAIL PROTECTED]]
>> Sent: 10 A
dear all,
I currently using postgresql v7.0.3
when i import text file to table with command "copy tablename from
'/tmp/a.txt';
and it shows
"copy: line 20, Cannot insert a duplicate key into unique index testpri_pk"
,then it exits with doing nothing.
I want to ignore this errors and continue copy
19 matches
Mail list logo