[SQL] constraint/restrict

2001-02-13 Thread Olaf Marc Zanger
hi there, with two tables i want to make some constraint-restrictions create table address ( id serial, country_id int4, ); and create table country (id serial, ...); to make sure that now country-row is deleted if there is still a country_id in address table. e.g. address: 1, 2, ... co

Re: [SQL] COPY isn't working right for me

2001-02-13 Thread Peter Eisentraut
Jeff S. writes: > create table member ( > member_id serial not null, > fname varchar(25) not null, > lname varchar(25) not null, > member_since date not null, > Primary Key (member_id) > ); > My member.txt file looks like this: > > Joe Smith 2000/01/14 > Frank Jones 2000/06/21 > Mike Davi

[SQL] COPY isn't working right for me

2001-02-13 Thread Jeff S.
I have a tab delimited file that I'm trying to import into an empty table. I've set the table up as follows: create table member ( member_id serial not null, fname varchar(25) not null, lname varchar(25) not null, member_since date not null, Primary Key (member_id) ); My member.txt file looks l

Re: [SQL] C/C++ interface

2001-02-13 Thread Bruce Momjian
Cursors and standard queries are pretty much the same, except the cursor can control the rows returned. > Hello, > > in the C interface documentation there is an example using: > > res = PQexec(conn, "DECLARE mycursor CURSOR FOR select * from > pg_database"); > if (!res || PQresultStatu

Re: [SQL] C/C++ interface

2001-02-13 Thread Tom Lane
Volker Paul <[EMAIL PROTECTED]> writes: > Is someone maintaining the C++ interface and its documentation? Not really. Feel free to step up and lend a hand ... regards, tom lane

Re: [SQL] ORDER BY in SQL functions

2001-02-13 Thread K. Ari Krupnikov
Tom Lane wrote: > > "K. Ari Krupnikov" <[EMAIL PROTECTED]> writes: > > CREATE FUNCTION foo (INT) > > RETURNS SETOF INT AS ' > > SELECT id > > FROM table > > WHERE some_colunm > $1 > > ORDER BY some_other_colunm > > ' LANGUAGE 'sql'; > > > ERROR: function declared to return in

[SQL] Inserting BLOB

2001-02-13 Thread Somashekharayya V H
Hi all, I am using following query to create new type 'lo' create type lo (internallength=4,externallength=10,input=int4in,output=int4out, default='',passedbyvalue); i am trying to insert the image by following query: insert into table (user_id,image) values ('som',lo_import('/u/

Re: [SQL]how to select * from database1 table,database2 table

2001-02-13 Thread Richard Huxton
From: "guard" <[EMAIL PROTECTED]> if join database1 database2 how to make I use VB or DELPHI You can't join between databases at present. I don't think this is in the pipeline for 7.2 even. The only solution I know of at present is to connect to two databases in the application and do the join

[SQL] C/C++ interface

2001-02-13 Thread Volker Paul
Hello, in the C interface documentation there is an example using: res = PQexec(conn, "DECLARE mycursor CURSOR FOR select * from pg_database"); if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) { fprintf(stderr, "DECLARE CURSOR command failed\n"); PQclear(res);

[SQL]how to select * from database1 table,database2 table

2001-02-13 Thread guard
if join database1 database2 how to make I use VB or DELPHI thanks