By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
CREATE INDEX
| logid | jobid | time | logtext |
|---|---|---|---|
| 1 | 1 | 2024-03-05 09:08:14.784927 | logtext1 |
INSERT 0 1
CREATE TABLE
| id | logid |
|---|---|
| 1 | 1 |
INSERT 0 1
| table_schema | table_name | column_name | data_type | udt_name | column_default | is_identity | identity_generation | identity_start | identity_increment | identity_maximum | identity_minimum |
|---|---|---|---|---|---|---|---|---|---|---|---|
| public | linked_to_log | id | bigint | int8 | null | YES | BY DEFAULT | 1 | 1 | 9223372036854775807 | 1 |
| public | linked_to_log | logid | integer | int4 | null | NO | null | null | null | null | null |
| public | log | logid | integer | int4 | nextval('log_logid_seq'::regclass) | NO | null | null | null | null | null |
| public | log | jobid | integer | int4 | null | NO | null | null | null | null | null |
| public | log | time | timestamp without time zone | timestamp | null | NO | null | null | null | null | null |
| public | log | logtext | text | text | null | NO | null | null | null | null | null |
SELECT 6
ALTER TABLE
ALTER TABLE
ALTER TABLE
| id_seq_restart |
|---|
| 2 |
SELECT 1
ALTER TABLE
| logid | jobid | time | logtext |
|---|---|---|---|
| 2 | 1 | 2024-03-05 09:08:14.820151 | logtext2 |
INSERT 0 1
| table_schema | table_name | column_name | data_type | udt_name | column_default | is_identity | identity_generation | identity_start | identity_increment | identity_maximum | identity_minimum |
|---|---|---|---|---|---|---|---|---|---|---|---|
| public | linked_to_log | id | bigint | int8 | null | YES | BY DEFAULT | 1 | 1 | 9223372036854775807 | 1 |
| public | linked_to_log | logid | integer | int4 | null | NO | null | null | null | null | null |
| public | log | logid | bigint | int8 | null | YES | BY DEFAULT | 1 | 1 | 9223372036854775807 | 1 |
| public | log | jobid | integer | int4 | null | NO | null | null | null | null | null |
| public | log | time | timestamp without time zone | timestamp | null | NO | null | null | null | null | null |
| public | log | logtext | text | text | null | NO | null | null | null | null | null |
SELECT 6
| pg_get_serial_sequence |
|---|
| public.log_logid_seq |
SELECT 1
DROP SEQUENCE
| logid | jobid | time | logtext |
|---|---|---|---|
| 3 | 1 | 2024-03-05 09:08:14.831573 | logtext3 |
INSERT 0 1
| pg_get_serial_sequence |
|---|
| public.log_logid_seq1 |
SELECT 1
ERROR: cannot drop sequence log_logid_seq1 because column logid of table log requires it HINT: You can drop column logid of table log instead.
| sequence_catalog | sequence_schema | sequence_name | data_type | numeric_precision | numeric_precision_radix | numeric_scale | start_value | minimum_value | maximum_value | increment | cycle_option |
|---|
SELECT 0
| schemaname | sequencename | sequenceowner | data_type | start_value | min_value | max_value | increment_by | cycle | cache_size | last_value |
|---|---|---|---|---|---|---|---|---|---|---|
| public | linked_to_log_id_seq | postgres | bigint | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 1 |
| public | log_logid_seq1 | postgres | bigint | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 3 |
SELECT 2
ALTER TABLE
| table_schema | table_name | column_name | data_type | udt_name | column_default | is_identity | identity_generation | identity_start | identity_increment | identity_maximum | identity_minimum |
|---|---|---|---|---|---|---|---|---|---|---|---|
| public | linked_to_log | id | bigint | int8 | null | YES | BY DEFAULT | 1 | 1 | 9223372036854775807 | 1 |
| public | linked_to_log | logid | bigint | int8 | null | NO | null | null | null | null | null |
| public | log | logid | bigint | int8 | null | YES | BY DEFAULT | 1 | 1 | 9223372036854775807 | 1 |
| public | log | jobid | integer | int4 | null | NO | null | null | null | null | null |
| public | log | time | timestamp without time zone | timestamp | null | NO | null | null | null | null | null |
| public | log | logtext | text | text | null | NO | null | null | null | null | null |
SELECT 6