Hi everyone,
I hope, I am on the right list. If not my apology.
I'd like to insert multiple lines as following with PLPython:
SQL statement:
INSET INTO table1 (field1, field2, field3)
VALES ('abc', 'abc', TRUE),
('def', 'def', FALSE),
('ghi', 'ghi', TRUE);
Merlin Moncure writes:
> On Fri, Jun 5, 2009 at 6:51 PM, Tom Lane wrote:
>> I think you can loop over the results in plpgsql, for instance
> also sql functions can direct 'returning' results directly to the
> return of the function (at least in 8.4).
That bit is new in 8.4, which is why I didn't
On Fri, Jun 5, 2009 at 6:51 PM, Tom Lane wrote:
> Joshua Tolley writes:
>> On Mon, Jun 01, 2009 at 04:21:27PM +0100, Shak wrote:
>>> Something like:
>>> SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
>>> sounds reasonable but results in a syntax error. I am able to return single
>>> results in
Joshua Tolley writes:
> On Mon, Jun 01, 2009 at 04:21:27PM +0100, Shak wrote:
>> Something like:
>> SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
>> sounds reasonable but results in a syntax error. I am able to return single
>> results into a variable or record, but not more than one result.
On Mon, Jun 01, 2009 at 04:21:27PM +0100, Shak wrote:
> When RETURNING from a DELETE statement (or similar), how do you access the
> results being returned?
>
> Something like:
>
> SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
>
> sounds reasonable but results in a syntax error. I am able to r
Ivan Sergio Borgonovo writes:
> I don't get it.
> Why dropping the triggers would cause a deadlock anyway?
> I bet it is due to my naïve view of the problem but I think a
> trigger is a "function". Unless there is concurrent access to the
> table where the function is defined... I can't see why
Could you give some examples of such utilities?
Thanks!
atul
-Original Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Joshua D. Drake
Sent: Friday, June 05, 2009 1:37 PM
To: Atul Chojar
Cc: pgsql-general@postgresql.org
Subjec
On Fri, 2009-06-05 at 10:58 -0700, Jean Hoderd wrote:
> The above example was absurdly simple, but in the real world the query
> is complex enough that instead of being just a SELECT is actually the
> return of a PL/PGSQL function. I just want a way to tell the client
> which fields from the retur
On Fri, 05 Jun 2009 10:46:11 -0400
Tom Lane wrote:
> Ivan Sergio Borgonovo writes:
> > I've encountered this error for the first time
> > psql:./import_stock_scratch.sql:9: ERROR: deadlock detected
> > DETAIL: Process 11095 waits for AccessExclusiveLock on relation
> > 250545 of database 24856
Hi,
> So I don't recommend you try to do this. What is the actual problem
> you are trying to solve? Why do you want the client library to be
> concerned with attnotnull at all?
In general the client library needs to check attnotnull to make sure
that the client is not making a type mistake.
Alan Hodgson wrote:
> On Tuesday 02 June 2009, "Carlos Oliva" wrote:
>
>> Is there a way to create a database or a table of a database in its own
>> folder? We are looking for ways to backup the sytem files of the
>> database to tape and one to exclude some tables from this backup. We
>> can
Thanks Chris & kretschmer. But one small doubt in it,, What happens to
update or insert query?
- Arvind S
*
"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison
*
On Fri, Jun 5, 2009 at 11:59 AM, Chris wrote:
> S Arvind wrote:
>
On Fri, Jun 5, 2009 at 6:27 PM, Brandon
Metcalf wrote:
> What would be the best way to maintain referential integrity in the
> following situation? Let's say I have the following table
>
> CREATE TABLE workorder (
> workorder_id INTEGER NOT NULL,
> part_id INTEGER DEFAULT NULL,
Brandon Metcalf wrote:
What would be the best way to maintain referential integrity in the
following situation? Let's say I have the following table
CREATE TABLE workorder (
workorder_id INTEGER NOT NULL,
part_id INTEGER DEFAULT NULL,
generic BOOLEAN DEFAULT FA
On Fri, 2009-06-05 at 13:12 -0400, Atul Chojar wrote:
> We want to implement a mechanism by which if any database function is
> created or modified in one database, then the same should
> automatically get done in another (1 or more) database(s).
>
>
>
> It seems triggers on system catalogs lik
Hi Matijn,
Thank you very much for the suggestion. I was able to figure this out
yesterday by running this query to get the source code from the view
then strip out the permission check and it work great.
select * from pg_views where viewname = 'table_privileges'
Thank you and Tom Lane for the
Jean Hoderd writes:
> I have tried the following, but it's not accepted:
> create type result as (name text not null, age int4 not null);
Frankly, the notion that a "not null" condition might be associated with
a SQL data type is simply a bad idea. The SQL committee let this happen
for domains i
On Wed, Jun 03, 2009 at 01:46:00PM -0500, Louis Lam wrote:
> So if I need to find out what table, view and function are granted to
> user or role. I should be force to use pg_class and pg_proc? Unless I
> can have superuser access?
Use \dv+ on the information_schema view you want and copy the qu
We want to implement a mechanism by which if any database function is
created or modified in one database, then the same should automatically get
done in another (1 or more) database(s).
It seems triggers on system catalogs like pg_proc are not allowed. Is there
any way in postgres to do this,
youngvon...@gmail.com wrote:
> On 6月4日, 下午1时52分, "youngvon...@gmail.com"
> wrote:
>
>> i want to understand database knowledge about ipc,store,etc with a
>> project,ie,postgresql. I want to ask postgresql source code is very
>> good, is worth to learn .
>>
> I want to ask if postgresql s
Dear list,
Here's the situation: I want to create a functional API to a Postgresql
database, in such a way that instead of issuing raw SQL commands (SELECT,
INSERT, etc), the client will only invoke functions from this API.
For example, to get all people in the database, the client will invoke
f
What would be the best way to maintain referential integrity in the
following situation? Let's say I have the following table
CREATE TABLE workorder (
workorder_id INTEGER NOT NULL,
part_id INTEGER DEFAULT NULL,
generic BOOLEAN DEFAULT FALSE,
PRIMARY KEY (
p == pgmaili...@codecraft.se writes:
p> On 4 jun 2009, at 22.17, Richard Broersma wrote:
p> > On Thu, Jun 4, 2009 at 1:13 PM, Brandon Metcalf
p> > wrote:
p> >> Is there a way when creating a table to limit it to one row? That
p> >> is,
p> >> without using a stored procedure?
p> >
p> >
"Anirban Pal" writes:
> Is there any way, to know the name of indexes on a table, defined in a
> database. I mean can I query something like
> Select Index_name from pg_class where relname = "Table_name" . Thanks in
> advance.
You need to join through pg_index, specifically its columns indrel
On Fri, Jun 5, 2009 at 9:57 AM, Tom Lane wrote:
> The ASCII code for '<' is 0x3c, not 0xab. I am not sure what you are
> actually typing; although it's suggestive that the LATIN1 code 0xab
> corresponds to a symbol that looks approximately like '<<'. The most
> likely bet is that you are typing t
On Tuesday 02 June 2009, "Carlos Oliva" wrote:
> Thank you for your response. The tablespace should work for us. Perhaps
> you can help me with the following questions:
>
> 1) If we were to create a different table space for a database that has
> archival tables -- they will be backed up once, i
On Tuesday 02 June 2009, "Carlos Oliva" wrote:
> Is there a way to create a database or a table of a database in its own
> folder? We are looking for ways to backup the sytem files of the
> database to tape and one to exclude some tables from this backup. We
> can selectively backup folders of t
The easiest way to get started is to use your package management
system to install PG for you. If you are on a Fedora/Centos or
similar based system then this is easily accomplished with the 'yum'
command. The minimal packages to add would likely be :
postgresql-server
postgresql
The latter giv
oops, I just realised you asked that question before :P
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
yes, it is called table space. Check this groups archive, it was
discussed quite recently.
--
GJ
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi all,
When RETURNING from a DELETE statement (or similar), how do you access the
results being returned?
Something like:
SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
sounds reasonable but results in a syntax error. I am able to return single
results into a variable or record, but no
Is there a way to create a database or a table of a database in its own
folder? We are looking for ways to backup the sytem files of the
database to tape and one to exclude some tables from this backup. We
can selectively backup folders of the file system so we figure that if
we can create a sche
Hi all,
When RETURNING from a DELETE statement (or similar), how do you access the
results being returned?
Something like:
SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;
sounds reasonable but results in a syntax error. I am able to return single
results into a variable or record, but not m
Is there a way to create a database or a table of a database in its own
folder? We are looking for ways to backup the sytem files of the
database to tape and one to exclude some tables from this backup. We
can selectively backup folders of the file system so we figure that if
we can create a sche
Thank you for your response. The tablespace should work for us. Perhaps you
can help me with the following questions:
1) If we were to create a different table space for a database that has
archival tables -- they will be backed up once, is it sufficient to backup the
tablespace folder once?
Thank you for your response. The tablespace should work for us. Perhaps you
can help me with the following questions:
1) If we were to create a different table space for a database that has
archival tables -- they will be backed up once, is it sufficient to backup the
tablespace folder once?
hello,
i am new to postgresql.actually i use openoffice for my database needs
but i see over internet people talking postgresql is the best solution
for database needs.i would love to make tables,queries,reports etc.can
you guide me what product i should download and use?
thanks and GOD ble
Would the backup be unrecoverable if I shutdown the databse first?
"Chris Browne" wrote in message
news:87ab4qfs48@dba2.int.libertyrms.com...
"Carlos Oliva" writes:
Is there a way to create a database or a table of a database in its own
folder? We are looking for ways to backup the sytem
Hi,
I'd like to get an array containing distinct values (always integers) form a
column in a table that is provided as a parameter. So I created this
function:
CREATE OR REPLACE FUNCTION get_distinct_values(table_name text, param_name
text)
RETURNS integer[] AS
$BODY$
DECLARE
_values integer[];
hello,all
i want to understand database knowledge about ipc,store,etc with a
project,ie,postgresql. I want to ask postgresql source code is very
good, is worth to learn .
thanks.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://
Ivan Sergio Borgonovo writes:
> I've encountered this error for the first time
> psql:./import_stock_scratch.sql:9: ERROR: deadlock detected
> DETAIL: Process 11095 waits for AccessExclusiveLock on relation
> 250545 of database 248569; blocked by process 11099. Process 11099
> waits for AccessSh
On 6月4日, 下午1时52分, "youngvon...@gmail.com"
wrote:
> hello,all
> i want to understand database knowledge about ipc,store,etc with a
> project,ie,postgresql. I want to ask postgresql source code is very
> good, is worth to learn .
>
> thanks.
I want to ask if postgresql source code is very well,an
Hi,
I keep having this need to create a function that will change the row data
as I am walking through the data. For example, I process each row in order,
if column1 change from previous row, set column2 to true.
Is this possible? I can run another query to modify the data, but that
doesn't see
I came across this curious behaviour today, at least in the 2009-03-24
beta (I can't run a newer beta), that I couldn't find in the docs,
although maybe I missed it. I found this really confusing until I
figured it out, so I thought I should share, and if it's not in the
docs, it should probably b
Hey there,
I developed a program where you must authenticate on startup. Now my
users already authenticate themselves when they login on Windows, so
basically they authenticate twice. To avoid this, the docs told me to
use GSSAPI or SSPI as psql authentication method, so my program could
use the Wi
I'm attempting to create a Foreign Key Constraint between a table and a
view in PostgreSQL 8.3. Ex:
ALTER TABLE public.table ADD CONSTRAINT table_to_view_fk
FOREIGN KEY (view_key)
REFERENCES public.view (view_key)
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE;
However, I get an error
Hi all,
Is there any way, to know the name of indexes on a table, defined in a
database. I mean can I query something like
Select Index_name from pg_class where relname = "Table_name" . Thanks in
advance.
--- Thanks & Reagrds
Anirban Pal | Software Engineer
Newgen Software Technolo
On Thu, Jun 04, 2009 at 11:11:29AM -0400, Bruce Momjian wrote:
> Jennifer Trey wrote:
> > Hi,
> > What file should I be working with?
>
> Just shut down the server and move the directory whever you want and
> restart the server. There are no file contents that need changing.
> Of course should ad
"Grand, Mark D." writes:
> ... I get this message:
> ERROR: invalid byte sequence for encoding "UTF8": 0xab
> HINT: This error can also happen if the byte sequence does not match the
> encoding expected by the server, which is controlled by "client_encoding".
> It is complaining about the '<'
On Fri, 2009-06-05 at 14:32 +0100, Richard Huxton wrote:
> Rafal Pietrak wrote:
> > The NEW tuple of the table EVENTLOG, in its ID field at the moment of
> > RULE execution has a value of 5! But after everything is finished, the
> > actual value deposited in that record is 4.
>
> A rule rewrites t
Rafal Pietrak wrote:
Now I'd like to write a RULE, that automatically updates references
between EVENTLOG and STATUS:
The NEW tuple of the table EVENTLOG, in its ID field at the moment of
RULE execution has a value of 5! But after everything is finished, the
actual value deposited in that reco
By George, I think you've got it!
(Imagine a hokey imitation British accent.)
I only had to make one small change. It complained it didn't know about a
column named "charge". When I changed it to:
select charge, (cn).* from (select charge, chargeneeds(charge) as cn from
charge) q;
it worke
I am having a vexing problem with a script I am writing to populate reference
tables in a new database.
I am running postgreSQL 8.3 with psql 8.3.7.
Psql reads this SQL statement:
INSERT INTO META_AUTH.DOMAIN_META_ASSERTION (TITLE, DESCRIPTION,
META_ASSERTION)
VALUES ('Super-User Aut
Hi All!
I've seen sometning unexpected here. I'd apreciate it if someone could
give me a hint of why this have happened and may be a sugesstion of a
workaround.
I'm writing "Building Access Control System" (BACS). My environment is
"Debian testing" with "their current" postgresql version: 8.3.7.
I've encountered this error for the first time
psql:./import_stock_scratch.sql:9: ERROR: deadlock detected
DETAIL: Process 11095 waits for AccessExclusiveLock on relation
250545 of database 248569; blocked by process 11099. Process 11099
waits for AccessShareLock on relation 250510 of database 2
Rastislav Hudak wrote:
> I'd like to get an array containing distinct values (always
> integers) form a column in a table that is provided as a
> parameter. So I created this function:
>
> CREATE OR REPLACE FUNCTION get_distinct_values(table_name text, param_name
> text)
> RETURNS integer[] A
56 matches
Mail list logo