[SQL] How to Get Column Names from the Table

2010-07-07 Thread venkat
Dear All, How to get Column Names from Table in PostgreSQL. Thanks and Regards, Venkat

Re: [SQL] How to Get Column Names from the Table

2010-07-07 Thread Viktor Bojović
\d tableName On Wed, Jul 7, 2010 at 11:08 AM, venkat ven.tammin...@gmail.com wrote: Dear All, How to get Column Names from Table in PostgreSQL. Thanks and Regards, Venkat -- --- Viktor Bojović --- Wherever I

Re: [SQL] How to Get Column Names from the Table

2010-07-07 Thread A. Kretschmer
In response to venkat : Dear All,    How to get Column Names from Table in PostgreSQL. select column_name from information_schema.columns where table_name = 'your_table'; Regards, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: - Header) GnuPG:

Re: [SQL] How to Get Column Names from the Table

2010-07-07 Thread venkat
Thanks alot Andreas...It is working fine... Thanks again. Venkat On Wed, Jul 7, 2010 at 2:44 PM, A. Kretschmer andreas.kretsch...@schollglas.com wrote: In response to venkat : Dear All, How to get Column Names from Table in PostgreSQL. select column_name from

Re: [SQL] [GENERAL] How to Get Column Names from the Table

2010-07-07 Thread Jayadevan M
Use: \d tablename And what I really like about it is the way you can make a guess about the table name and use * . postgres-# \d mt* Table public.mt1 Column | Type | Modifiers +-+--- id | integer | Table public.mt2 Column | Type | Modifiers

Re: [GENERAL] [SQL] How to Get Column Names from the Table

2010-07-07 Thread venkat
Dear Sreelatha. It is working fine. Thanks alot. Thanks and Regards, Venkat On Wed, Jul 7, 2010 at 3:42 PM, Sreelatha G sreetla...@gmail.com wrote: Hi, To get column names only select column_name from information_schema.columns where table_name='captor_prime_aggregates'; Thanks

Re: [SQL]

2010-07-07 Thread Justin Graf
On 7/7/2010 12:00 AM, silly sad wrote: On 07/06/10 21:52, Justin Graf wrote: I wrote an article covering this on the wiki http://wiki.postgresql.org/wiki/BinaryFilesInDB there are some red flags in communication (particularly reading papers) one of them is binary data which

[SQL] strangest thing happened

2010-07-07 Thread John
I am the only developer, DBA etc.. for a small project. Today (yesterday was everything was perfect) many of the sequence numbers fell behind what is the actual PK value. For example the invoice PK sequence current value = 1056 but the table PK was 1071. Nobody (other than myself) knows how

Re: [SQL] strangest thing happened

2010-07-07 Thread John
Yes I'm using auto_increment (serial data type). No function, method inserts PK's anywhere in my code. I'm thinking/guessing it had something to do with vacumn or the backup. I have been using Postgres for a number of years now and I never seen this in the past. So I'm really at a loss as

[SQL] tsearch2 and wildcards/pattern matching?

2010-07-07 Thread Peter Koczan
Hi all, Is there any sort of pattern matching or partial matching capability in tsearch2? I'd like to be able search for a common prefix (like for order numbers). For instance, tsearch2 will index 'zvt123456' or 'zvt55', but I'd like to be able to find both of them in one query using

Re: [SQL] strangest thing happened

2010-07-07 Thread Ross J. Reedstrom
On Wed, Jul 07, 2010 at 04:25:13PM -0500, Justin Graf wrote: Are you using PG's sequence/auto increment??? If so. Once PG fires off the nextval() for the sequence that number is considered used and gone even if the transaction that called nextval() is rolled back Depending on how the

Re: [SQL] strangest thing happened

2010-07-07 Thread Joe Conway
On 07/07/2010 12:59 PM, John wrote: I am the only developer, DBA etc.. for a small project. Today (yesterday was everything was perfect) many of the sequence numbers fell behind what is the actual PK value. For example the invoice PK sequence current value = 1056 but the table PK was

Re: [SQL] strangest thing happened

2010-07-07 Thread Justin Graf
On 7/7/2010 3:42 PM, Ross J. Reedstrom wrote: Justin, you're missing that John reported that the sequences are _behind_ the table. This only happens for me if I've been doing bulk data loads. Then I use: select setval(sequence_name,max(serial_id_column)) from table_with_serial_id; You do

[SQL] How to find events within a timespan to each other?

2010-07-07 Thread Andreas
Hi, is there a way to find events in a log that happen within a certain timespan to each other? Log is like this event_idinteger not null default 0 primary key event_type_idinteger not null default user_idinteger not null default 0 event_ts

Re: [SQL] How to find events within a timespan to each other?

2010-07-07 Thread Tim Landscheidt
(anonymous) wrote: is there a way to find events in a log that happen within a certain timespan to each other? Log is like this event_idinteger not null default 0 primary key event_type_idinteger not null default user_idinteger not null default 0

Re: [SQL] strangest thing happened

2010-07-07 Thread John
On Wednesday 07 July 2010 03:14:40 pm Justin Graf wrote: I would be looking at the log files for the Inserts into that table as a means to track down what is the cause.  If there are no log files or don't have enough detail, crank up the logging level and wait for it to happen again??? That

Re: [SQL] tsearch2 and wildcards/pattern matching?

2010-07-07 Thread Oleg Bartunov
it's called prefix search: =# select 'zvt123456'::tsvector @@ 'zvt:*'; ?column? -- t On Wed, 7 Jul 2010, Peter Koczan wrote: Hi all, Is there any sort of pattern matching or partial matching capability in tsearch2? I'd like to be able search for a common prefix (like for order

Re: [SQL] tsearch2 and wildcards/pattern matching?

2010-07-07 Thread Peter Koczan
On Wed, Jul 7, 2010 at 5:44 PM, Oleg Bartunov o...@sai.msu.su wrote: it's called prefix search: =# select 'zvt123456'::tsvector @@ 'zvt:*';  ?column? --  t Ah, that works. Excellent. Thanks, Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to