Try:
Create table table1(field1,field2) as (select field1, field2 from table2);
-Original Message-
From: Joseph Syjuco [SMTP:[EMAIL PROTECTED]]
Sent: Monday, September 03, 2001 3:03 AM
To: [EMAIL PROTECTED]
Subject:
im new in postgresql (actually came from SQL Server) an
This is Oracle's syntax for an outer join. Try this in PostgreSQL
SELECT o.* from one o LEFT JOIN two t ON o.key = t.key;
-Original Message-
From: Christopher Audley [SMTP:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 3:57 PM
To: [EMAIL PROTECTED]
Subject:Oracle to Pos
Try eliminating the statement " from user_group_map map". It does not belong in the
update. Here is the fully rewritten statement:
update
user_group_map
set
user_id = 4
where
user_id = 9 and
not exists (
select * from
I would like to create a pl/pgsql function that can select from a table
even though users can't select from the table directly. For example,
create a table and function that hits the table as the postgres user. Log
in as another user and select function_name();. This fails because the
user
Setting NEW in an AFTER update or insert trigger is not wise. Try using a before
update trigger instead.
-Original Message-
From: Joseph Shraibman [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, February 06, 2001 6:35 PM
To: [EMAIL PROTECTED]
Subject:plpgsql error: cache looku
When declaring parameters try using varchar rather than varchar(255). I have used
text successfully in the past.
-Original Message-
From: Ken Corey [SMTP:[EMAIL PROTECTED]]
Sent: Sunday, February 04, 2001 6:38 AM
To: [EMAIL PROTECTED]
Subject:Hrm...why is this wrong?
In
You could send the column name directly into your c function. For example:
c_function_name(NEW.col1, NEW.col2, NEW.col3). Otherwise I am not sure how
to send NEW into a C function. You could try declaring NEW in your C
function as a tuple.
-Original Message-
From: Joe Conway [SMTP
Did you insert a row into table2? What happens if there is no row in table
1 where id = code (of the newly inserted row in table2). Seems to me you
many need to consider expanding increment_value() to check table1 to see if
code exists. If not insert a new value, else update.
-Original
Try:
insert into table (name,id,city) values ('roger rabbit',NULL,'carrot city')
-Original Message-
From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 7:16 AM
To: [EMAIL PROTECTED]
Subject:no value for numeric filed in SQL statement cause
The column name is OID.
-Original Message-
From: Padmajha Raghunathan [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 11:20 PM
To: [EMAIL PROTECTED]
Subject:Rownum/ row Id
Hi,
Is there a provision to delete the duplicate records using row num/
row id as avai
Try using aggregate functions. Creating your own aggregate function is
fairly easy and can produce the exact results you are looking for. In
case this is not good enough, here is an example of some code I used to
loop through rows in a table in pl/pgsql
CREATE FUNCTION pending_post_transact
This works for me:
SELECT DISTINCT c.relname as table_name, a.attname as column_name, t.typname, pa.adsrc
as default
FROM (pg_attribute a
join pg_class c on a.attrelid = c.oid
join pg_type t on a.atttypid = t.oid)
left join pg_attrdef pa on c.oid = pa.adrelid AND a
In psql you can try \g or \o.
-Original Message-
From:[SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 10:03 PM
To: [EMAIL PROTECTED]
Subject:SQL Query Results
I want to show a certain person the commands I type and the query results,
and I want to save them i
Did you execute the following after you created your database?
CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS
'/usr/local/pgsql/lib/plpgsql.so' LANGUAGE 'C';
CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
HANDLER plpgsql_call_handler
LANCOMPILER 'PL/pgSQL';
These are
Select now() + 7;
-Original Message-
From: john whale [SMTP:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 10:30 AM
To: '[EMAIL PROTECTED]'
Subject:DATE
PLEASE ADVISE HOW I SHOULD ALTER THE COMMAND:
<$NOW;DD;>
TO GIVE ME A DATE THAT IS X DAYS FORWARD
ie: I
Here's a start:
select g.groname as group, g.grosysid as group_id, u.usename as user,
u.usesysid as user_id from pg_group g, pg_user u
where u.usesysid = g.grolist[1] or u.usesysid = g.grolist[2] or
u.usesysid = g.grolist[3] or u.usesysid = g.grolist[4] or u.usesysid =
g.grolist[5] or
1) Select t1.* from table_1 t1, table2 t2 where t1.column = t2.column;
2) Select t1.* from table_1 t1 join table2 t2 on t1.column = t2.column;
-Original Message-
From: Stephan Richter [SMTP:[EMAIL PROTECTED]]
Sent: Sunday, January 21, 2001 11:20 PM
To: [EMAIL PROTECTED]
Subject:
al functions that
already exist to convert numeric to text so that I don't have to write one?
I know that psql successfully does this.
Thanks, Michael Davis
Database Architect and Senior Software Engineer, Seva Inc.
Office: 303-460-7360Fax: 303-460-7362
Mobile: 720-320-6971
Email: [EMAIL PROTECTED]
Does anyone know how to completely and accurately remove or drop a
constraint, specifically a foreign key constraint? I tried to remove a
constraint by deleting it's trigger from pg_triggers. This caused some
undesirable side effects with other tables involved with the constraint. I
have se
aymentLineID, Amount)
VALUES(9, nextval('Payments_s'), '1/1/2001',
nextval('PaymentLines_s'), 10);
The Payments_s sequences is bumped on both inserts. As a result, the
insert into the PaymentLines table has a different PaymentsID that the
inse
before rule #1).
Any suggestions on how to get this to work? Any help is greatly
appreciated.
Thanks, Michael Davis
21 matches
Mail list logo